Exemplo n.º 1
0
        public void Insert(T obj)
        {
            ClinicSystemContext con = new ClinicSystemContext();

            con.Set <T>().Add(obj);
            con.SaveChanges();
        }
Exemplo n.º 2
0
        public List <Module> LoadMain()
        {
            ClinicSystemContext con         = new ClinicSystemContext();
            List <Module>       MainModules = (from a in con.Modules
                                               select a).ToList <Module>();

            return(MainModules);
        }
Exemplo n.º 3
0
        public void Update(T obj)
        {
            ClinicSystemContext con = new ClinicSystemContext();

            con.Set <T>().Attach(obj);
            con.Entry(obj).State = EntityState.Modified;
            con.SaveChanges();
        }
Exemplo n.º 4
0
        public void Delete(object id)
        {
            ClinicSystemContext con = new ClinicSystemContext();
            T del = con.Set <T>().Find(id);

            con.Set <T>().Remove(del);
            con.SaveChanges();
        }
Exemplo n.º 5
0
        public List <Module> Loadmodules()
        {
            ClinicSystemContext con        = new ClinicSystemContext();
            List <Module>       SubModules = (from a in con.Modules
                                              where a.SubModule == 0
                                              select a).ToList <Module>();

            return(SubModules);
        }
Exemplo n.º 6
0
 public PatientsController(ClinicSystemContext context)
 {
     _context = context;
 }
Exemplo n.º 7
0
        public List <T> LoadAll()
        {
            ClinicSystemContext con = new ClinicSystemContext();

            return(con.Set <T>().ToList <T>());
        }
Exemplo n.º 8
0
        public T Load(int id)
        {
            ClinicSystemContext con = new ClinicSystemContext();

            return(con.Set <T>().Find(id));
        }