public void Insert(T obj) { CrystelContext con = new CrystelContext(); con.Set <T>().Add(obj); con.SaveChanges(); }
public List <Department> LoadMain() { CrystelContext con = new CrystelContext(); List <Department> MainDepartment = (from a in con.Departments select a).ToList <Department>(); return(MainDepartment); }
public void Update(T obj) { CrystelContext con = new CrystelContext(); con.Set <T>().Attach(obj); con.Entry(obj).State = EntityState.Modified; con.SaveChanges(); }
public void Delete(object id) { CrystelContext con = new CrystelContext(); T del = con.Set <T>().Find(id); con.Set <T>().Remove(del); con.SaveChanges(); }
public List <Employee> LoadMain() { CrystelContext con = new CrystelContext(); List <Employee> MainEmployee = (from a in con.Employees select a).ToList <Employee>(); return(MainEmployee); }
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); }
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); }
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); }
public List <T> LoadAll() { CrystelContext con = new CrystelContext(); return(con.Set <T>().ToList <T>()); }
public T Load(int id) { CrystelContext con = new CrystelContext(); return(con.Set <T>().Find(id)); }