BLL.Miembros.Insertar C# (CSharp) Method

Insertar() public method

public Insertar ( ) : bool
return bool
        public override bool Insertar()
        {
            bool retorno = false;

            try
            {
                retorno = con.Ejecutar(string.Format("insert into Miembros (Nombre, Apellidos, Parentesco, esActivo, UsuarioId) values ('{0}','{1}','{2}',{3},{4})", this.Nombre, this.Apellidos, this.Parentesco, this.esActivo, this.UsuarioId));
            }
            catch (Exception)
            {

                retorno = false;
            }

            return retorno;
       
        }

Usage Example

        public void InsertarTest()
        {
            Miembros miembro = new Miembros();
           
            miembro.Nombre = "Familia";
            miembro.esActivo = 1;
            miembro.UsuarioId = 5;

            Assert.IsTrue(miembro.Insertar());
        }
All Usage Examples Of BLL.Miembros::Insertar