public bool Delete(TabTemplate 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($"TabTemplate Del fail:{ex.Message}"); } }
public bool Insert(UsersGroupsRel t) { try { Func <bool> func = new Func <bool>(() => { using (var db = new Dashboard1Entities()) { t.stat_void = 0; db.Entry(t).State = System.Data.Entity.EntityState.Added; db.SaveChanges(); return(true); } }); return(_adapter.Catch <bool>(func)); } catch (Exception ex) { throw new Exception($"UsersGroupsRel Insert fail:{ex.Message}"); } }
public bool Insert(Item t) { try { Func <bool> func = new Func <bool>(() => { using (var db = new Dashboard1Entities()) { t.stat_void = 0; t.dt_create = DateTime.Now; db.Entry(t).State = System.Data.Entity.EntityState.Added; db.SaveChanges(); return(true); } }); return(_adapter.Catch <bool>(func)); } catch (Exception ex) { throw new Exception($"ItemRepositry GetAll fail:{ex.Message}"); } }
public bool Update(Group t) { try { Func <bool> func = new Func <bool>(() => { using (var db = new Dashboard1Entities()) { t.stat_void = 0; db.Entry(t).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(true); } }); return(_adapter.Catch <bool>(func)); } catch (Exception ex) { throw new Exception($"GroupRepositry Update fail:{ex.Message}"); } }