//// =================================Entity===============================// public bool CheckID(EmployeeDoc EmpId) { using (SADEntities1 db = new SADEntities1()) { if (db.Employees.Any(p => p.ID == EmpId.ID)) { return(true); } return(false); } }
public Employee InsertInfor(EmployeeDoc employeeinfor) { using (SADEntities1 db = new SADEntities1()) { Employee employee = new Employee(); employee.ID = employeeinfor.ID; employee.Name = employeeinfor.Name; employee.Department = employeeinfor.Department; employee.Salary = Enmd5.Encrypt(employeeinfor.Salary); db.Employees.Add(employee); db.SaveChanges(); return(employee); } }
public List <EmployeeDoc> GetAllInfor() { List <EmployeeDoc> EmployeeList = new List <EmployeeDoc>(); using (SADEntities1 db = new SADEntities1()) { var emp = db.Employees.ToList(); foreach (var item in emp) { EmployeeList.Add(new EmployeeDoc { ID = item.ID, Name = item.Name, Department = item.Department, Salary = demd5.Decrypt(item.Salary) }); } } return(EmployeeList); }
public List <Recruitment> GetInf() { List <Recruitment> RecruitmentList = new List <Recruitment>(); using (SADEntities1 db1 = new SADEntities1()) { var rec = db1.Candidates.ToList(); foreach (var item in rec) { RecruitmentList.Add(new Recruitment { ID = item.ID, Name = item.Name, Address = item.Address, Email = item.Email, Phone = item.Phone }); } } return(RecruitmentList); }