public bool EditBPT(BehaviorPageTow bPT) { _appDbContext.Entry(bPT).State = EntityState.Modified; try { _appDbContext.SaveChanges(); } catch { return(false); } return(true); }
public bool delete(long Id) { BehaviorPageTow bPT = _appDbContext.BehaviorPageTow.FirstOrDefault(d => d.Id == Id); IEnumerable <InterventionsModified> iM = _appDbContext.InterventionsModified.Where(d => d.BPTid == bPT.Id).ToList(); foreach (var item1 in iM) { _appDbContext.InterventionsModified.Remove(item1); _appDbContext.SaveChanges(); } _appDbContext.BehaviorPageTow.Remove(bPT); try { _appDbContext.SaveChanges(); } catch { return(false); } return(true); }
public bool EditBPT(BehaviorPageTow bPT) { return(true); }
public bool addNewItem(BehaviorPageTow behaviorPageTow) { return(true); }
public bool addNewItem(BehaviorPageTow behaviorPageTow) { _appDbContext.BehaviorPageTow.Add(behaviorPageTow); _appDbContext.SaveChanges(); return(true); }