コード例 #1
0
        public bool AnularDB(Grupo_Info info)
        {
            try
            {
                using (EntitiesGeneral db = new EntitiesGeneral())
                {
                    Grupo Entity = db.Grupo.Where(q => q.IdLinea == info.IdLinea && q.IdGrupo == info.IdGrupo).FirstOrDefault();
                    if (Entity == null)
                    {
                        return(false);
                    }

                    Entity.gr_Estado = false;
                    db.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #2
0
 public bool GuardarDB(Grupo_Info info)
 {
     try
     {
         using (EntitiesGeneral db = new EntitiesGeneral())
         {
             db.Grupo.Add(new Grupo
             {
                 IdLinea        = info.IdLinea,
                 IdGrupo        = info.IdGrupo = GetId(),
                 gr_Codigo      = info.gr_Codigo,
                 gr_Descripcion = info.gr_Descripcion,
                 gr_Estado      = true
             });
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }