예제 #1
0
        public void Insert(T obj)
        {
            CrystelContext con = new CrystelContext();

            con.Set <T>().Add(obj);
            con.SaveChanges();
        }
예제 #2
0
        public List <Department> LoadMain()
        {
            CrystelContext    con            = new CrystelContext();
            List <Department> MainDepartment = (from a in con.Departments
                                                select a).ToList <Department>();

            return(MainDepartment);
        }
예제 #3
0
        public void Update(T obj)
        {
            CrystelContext con = new CrystelContext();

            con.Set <T>().Attach(obj);
            con.Entry(obj).State = EntityState.Modified;
            con.SaveChanges();
        }
예제 #4
0
        public void Delete(object id)
        {
            CrystelContext con = new CrystelContext();
            T del = con.Set <T>().Find(id);

            con.Set <T>().Remove(del);
            con.SaveChanges();
        }
예제 #5
0
        public List <Employee> LoadMain()
        {
            CrystelContext  con          = new CrystelContext();
            List <Employee> MainEmployee = (from a in con.Employees
                                            select a).ToList <Employee>();

            return(MainEmployee);
        }
예제 #6
0
        public List <Job_Title> LoadMain()
        {
            CrystelContext   con     = new CrystelContext();
            List <Job_Title> MainJob = (from a in con.Job_Titles
                                        select a).ToList <Job_Title>();

            return(MainJob);
        }
예제 #7
0
        public List <ProjectName> LoadMain()
        {
            CrystelContext     con         = new CrystelContext();
            List <ProjectName> MainProject = (from a in con.ProjectNames
                                              where a.Id != 1
                                              select a).ToList <ProjectName>();

            return(MainProject);
        }
예제 #8
0
        public List <Skills> LoadMain()
        {
            CrystelContext con         = new CrystelContext();
            List <Skills>  MainProject = (from a in con.Skills
                                          where a.Id != 1
                                          select a).ToList <Skills>();

            return(MainProject);
        }
예제 #9
0
        public List <T> LoadAll()
        {
            CrystelContext con = new CrystelContext();

            return(con.Set <T>().ToList <T>());
        }
예제 #10
0
        public T Load(int id)
        {
            CrystelContext con = new CrystelContext();

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