Ejemplo n.º 1
0
Archivo: Data.cs Proyecto: ttkha/SAD1
 //// =================================Entity===============================//
 public bool CheckID(EmployeeDoc EmpId)
 {
     using (SADEntities1 db = new SADEntities1())
     {
         if (db.Employees.Any(p => p.ID == EmpId.ID))
         {
             return(true);
         }
         return(false);
     }
 }
Ejemplo n.º 2
0
Archivo: Data.cs Proyecto: ttkha/SAD1
 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);
     }
 }
Ejemplo n.º 3
0
Archivo: Data.cs Proyecto: ttkha/SAD1
        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);
        }
Ejemplo n.º 4
0
        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);
        }