public bool Delete(UsersGroupsRel t) { try { Func <bool> func = new Func <bool>(() => { using (var db = new Dashboard1Entities()) { t.stat_void = 1; db.Entry(t).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(true); } }); return(_adapter.Catch <bool>(func)); } catch (Exception ex) { throw new Exception($"UsersGroupRel Del fail:{ex.Message}"); } }
public IEnumerable <zp_get_not_exists_group_Result> GetHiddenClass(string empno) { try { Func <IEnumerable <zp_get_not_exists_group_Result> > func = new Func <IEnumerable <zp_get_not_exists_group_Result> >(() => { using (var db = new Dashboard1Entities()) { return(db.zp_get_not_exists_group(empno).ToList()); } }); return(_adapter.Catch <IEnumerable <zp_get_not_exists_group_Result> >(func)); } catch (Exception ex) { throw new Exception($"ExtentRepository GetHiddenClass fail:{ex.Message}"); } }
public bool Delete(Item t) { try { Func <bool> func = new Func <bool>(() => { using (var db = new Dashboard1Entities()) { t.dt_update = DateTime.Now; t.stat_void = 1; db.Entry(t).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(true); } }); return(_adapter.Catch <bool>(func)); } catch (Exception ex) { throw new Exception($"ItemRepositry Delete fail:{ex.Message}"); } }