public List <Template> GetAll() { using (var dbContext = new DBQueryToolDbContext()) { return(dbContext.Templates.ToList()); } }
public List <Report> GetAll() { using (var dbContext = new DBQueryToolDbContext()) { return(dbContext.Reports.ToList()); } }
public List <User> GetAll() { using (var dbContext = new DBQueryToolDbContext()) { return(dbContext.Users.ToList()); } }
public void Remove(Report entity) { using (var dbContext = new DBQueryToolDbContext()) { dbContext.Reports.Remove(entity); dbContext.SaveChanges(); } }
public ObservableCollection <Template> GetObservableCollection() { using (var dbContext = new DBQueryToolDbContext()) { dbContext.Templates.Load(); return(dbContext.Templates.Local); } }
public void Remove(Template entity) { using (var dbContext = new DBQueryToolDbContext()) { dbContext.Templates.Remove(entity); dbContext.SaveChanges(); } }
public Report Add(Report entity) { using (var dbContext = new DBQueryToolDbContext()) { dbContext.Reports.Add(entity); dbContext.SaveChanges(); return(entity); } }
public TemplateType Add(TemplateType entity) { using (var dbContext = new DBQueryToolDbContext()) { dbContext.TemplateTypes.Add(entity); dbContext.SaveChanges(); return(entity); } }
public User Add(User entity) { using (var dbContext = new DBQueryToolDbContext()) { dbContext.Users.Add(entity); dbContext.SaveChanges(); return(entity); } }
public Report Update(Report entity) { using (var dbContext = new DBQueryToolDbContext()) { var found = dbContext.Reports.Find(entity); if (found == null) { return(null); } dbContext.Reports.Add(entity); dbContext.SaveChanges(); return(entity); } }
public Template Update(Template entity) { using (var dbContext = new DBQueryToolDbContext()) { var found = dbContext.Templates.Find(entity); if (found == null) { return(null); } dbContext.Templates.Add(entity); dbContext.SaveChanges(); return(entity); } }