public bool Insert(TabTemplate 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($"TabTemplate Insert fail:{ex.Message}"); } }
public bool Delete(Users 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($"Users Del 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(ItemGroupRel 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($"ItemGroupRelRepositry GetAll fail:{ex.Message}"); } }