Ejemplo n.º 1
0
 public void eliminar(clsBajaActivo baja)
 {
     using (ActivoFijoEntities ent = new ActivoFijoEntities())
     {
         //Hago un wehere por el primaryKey codigo
         var x = (from q in ent.BajaActivo where q.idBajaActivo == baja.Codigo select q).First();
         //Eliminar es muy parecido
         //Eliminar el registro que me trajpp el select
         ent.DeleteObject(x);
         ent.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public Boolean eliminar(clsDepreciacionDet DepreDet, clsDepreciacionCab DepreCab)
 {
     try
     {
         using (ActivoFijoEntities ent = new ActivoFijoEntities())
         {
             //Hago un wehere por el primaryKey codigo
             var x = (from q in ent.DepreciacionDet where q.Secuencia_DepreciacionDet == DepreDet.Codigo_SecuDepreciDet select q).First();
             var p = (from r in ent.DepreciacionCab where r.Secuencia_DepreciacionCab == DepreCab.Codigo_SecuDepreciCab select r).First();
             //Eliminar es muy parecido
             //Eliminar el registro que me trajpp el select
             ent.DeleteObject(x);
             ent.DeleteObject(p);
             ent.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
 public Boolean  eliminar(clsSubgrupoActivoFijo SubActivo)
 {
     try
     {
         using (ActivoFijoEntities ent = new ActivoFijoEntities())
         {
             //Hago un wehere por el primaryKey codigo
             var x = (from q in ent.SubGrupos where q.IdSubGrupo == SubActivo.Codigo select q).First();
             //Eliminar es muy parecido
             //Eliminar el registro que me trajpp el select
             ent.DeleteObject(x);
             ent.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }