Exemplo n.º 1
0
        public bool DeleteSector(tbl_Sector row)
        {
            try
            {
                using (var db = new SoneriCISEntities())
                {
                    tbl_Sector val = new DAL.tbl_Sector();
                    val          = db.tbl_Sector.Where(a => a.ID == row.ID).FirstOrDefault();
                    val.IsActive = false;

                    db.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemplo n.º 2
0
 public bool UpdateSector(tbl_Sector row)
 {
     try
     {
         using (var db = new SoneriCISEntities())
         {
             tbl_Sector val = new DAL.tbl_Sector();
             val             = db.tbl_Sector.Where(a => a.Code == row.Code).FirstOrDefault();
             val.Code        = row.Code;
             val.Description = row.Description;
             val.IsActive    = row.IsActive;
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }