public void Update(TecnicoEntity objEnt)
        {
            con = objCon.Conectar();
            con.Open();

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "SP_UPD_TECNICO";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = con;

            cmd.Parameters.Add("@IDTECNICO", SqlDbType.Int).Value          = objEnt.IdTecnico;
            cmd.Parameters.Add("@NOMBRE", SqlDbType.VarChar, 50).Value     = objEnt.Nombre;
            cmd.Parameters.Add("@APEPATERNO", SqlDbType.VarChar, 50).Value = objEnt.ApePaterno;
            cmd.Parameters.Add("@APEMATERNO", SqlDbType.VarChar, 50).Value = objEnt.ApeMaterno;
            cmd.Parameters.Add("@USUARIO", SqlDbType.VarChar, 50).Value    = objEnt.Usuario;
            cmd.Parameters.Add("@CLAVE", SqlDbType.NVarChar, 300).Value    = objEnt.Clave;
            cmd.Parameters.Add("@FLGESTADO", SqlDbType.Int).Value          = objEnt.FLGTecnico;

            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception)
            {
                throw;
            }
        }
        public DataTable Login(string user, string pass)
        {
            TecnicoModel  objMod = new TecnicoModel();
            TecnicoEntity objEnt = new TecnicoEntity();

            objEnt.Usuario    = user;
            objEnt.ApePaterno = pass;


            return(objMod.Login(objEnt));
        }
        public void Delete(TecnicoEntity objEnt)
        {
            con = objCon.Conectar();
            con.Open();

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "SP_DEL_TECNICO";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = con;

            cmd.Parameters.Add("@IDTECNICO", SqlDbType.Int).Value = objEnt.IdTecnico;

            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception)
            {
                throw;
            }
        }
        public DataTable Login(TecnicoEntity objEnt)
        {
            DataTable dt = new DataTable("tecnico");

            try
            {
                con = objCon.Conectar();
                con.Open();

                SqlDataAdapter da = new SqlDataAdapter("SP_LOGIN", con);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                da.SelectCommand.Parameters.Add("@USUARIO", SqlDbType.VarChar, 50).Value  = objEnt.Usuario;
                da.SelectCommand.Parameters.Add("@PASSWORD", SqlDbType.VarChar, 50).Value = objEnt.Clave;

                da.Fill(dt);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(dt);
        }
 public void Delete(TecnicoEntity objEnt)
 {
     objMod.Delete(objEnt);
 }
 public void Update(TecnicoEntity objEnt)
 {
     objMod.Update(objEnt);
 }
 public void Add(TecnicoEntity objEnt)
 {
     objMod.Insert(objEnt);
 }