Exemplo n.º 1
0
 public List <Template> GetAll()
 {
     using (var dbContext = new DBQueryToolDbContext())
     {
         return(dbContext.Templates.ToList());
     }
 }
Exemplo n.º 2
0
 public List <Report> GetAll()
 {
     using (var dbContext = new DBQueryToolDbContext())
     {
         return(dbContext.Reports.ToList());
     }
 }
Exemplo n.º 3
0
 public List <User> GetAll()
 {
     using (var dbContext = new DBQueryToolDbContext())
     {
         return(dbContext.Users.ToList());
     }
 }
Exemplo n.º 4
0
 public void Remove(Report entity)
 {
     using (var dbContext = new DBQueryToolDbContext())
     {
         dbContext.Reports.Remove(entity);
         dbContext.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public ObservableCollection <Template> GetObservableCollection()
 {
     using (var dbContext = new DBQueryToolDbContext())
     {
         dbContext.Templates.Load();
         return(dbContext.Templates.Local);
     }
 }
Exemplo n.º 6
0
 public void Remove(Template entity)
 {
     using (var dbContext = new DBQueryToolDbContext())
     {
         dbContext.Templates.Remove(entity);
         dbContext.SaveChanges();
     }
 }
Exemplo n.º 7
0
 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);
     }
 }
Exemplo n.º 9
0
 public User Add(User entity)
 {
     using (var dbContext = new DBQueryToolDbContext())
     {
         dbContext.Users.Add(entity);
         dbContext.SaveChanges();
         return(entity);
     }
 }
Exemplo n.º 10
0
        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);
            }
        }
Exemplo n.º 11
0
        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);
            }
        }