Ejemplo n.º 1
0
 public List <Location> ListLocation()
 {
     using (var LocationDBContext = new WorkScheduleDBContext())
     {
         return(LocationDBContext.Locations.ToList());
     }
 }
Ejemplo n.º 2
0
 public List <Employee> getEmployeeList(int id)
 {
     using (var context = new WorkScheduleDBContext())
     {
         var data = from Employee in context.Employees where Employee.EmployeeID == id select Employee;
         return(data.ToList());
     }
 }
Ejemplo n.º 3
0
 public void DeleteEmployeeInfo(Employee Entities)
 {
     using (var context = new WorkScheduleDBContext())
     {
         var existingvalue = context.Employees.Find(Entities.EmployeeID);
         context.Employees.Remove(existingvalue);
         context.SaveChanges();
     }
 }
Ejemplo n.º 4
0
 public void UpdateEmployeeInfo(Employee Entities)
 {
     using (var context = new WorkScheduleDBContext())
     {
         var updating = context.Employees.Attach(Entities);
         var matchingWithExistingValues = context.Entry <Employee>(updating);
         matchingWithExistingValues.State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Ejemplo n.º 5
0
 public List <DropDwonListPOCOs> getDropDwonList()
 {
     using (var context = new WorkScheduleDBContext())
     {
         var data = from EmployeeSkill in context.EmployeeSkills
                    select new DropDwonListPOCOs
         {
             ID           = EmployeeSkill.EmployeeID,
             Descripotion = EmployeeSkill.Skill.Description
         };
         return(data.ToList());
     }
 }
Ejemplo n.º 6
0
 public List <EmployeeSkillPOCOs> getEmployeeSkillPOCOs()
 {
     using (var context = new WorkScheduleDBContext())
     {
         var result = from employeeskill in context.EmployeeSkills
                      orderby employeeskill.Employee.LastName
                      select new EmployeeSkillPOCOs()
         {
             Skill = employeeskill.Skill.Description,
             Name  = employeeskill.Employee.LastName + ", " + employeeskill.Employee.FirstName,
             Phone = employeeskill.Employee.HomePhone,
             Level = employeeskill.Level.ToString(),
             YOE   = employeeskill.YearsOfExperience
         };
         return(result.ToList());
     };
 }
Ejemplo n.º 7
0
        public List <EmployeeMenu> getReportEmployeeMenu()
        {
            using (var context = new WorkScheduleDBContext())
            {
                var list = from employee in context.Employees
                           orderby employee.EmployeeID
                           select new EmployeeMenu
                {
                    EmployeeID = employee.EmployeeID,
                    Name       = employee.FirstName + " " + employee.LastName,
                    HomePhone  = employee.HomePhone,
                    Active     = employee.Active
                };

                return(list.ToList());
            }
        }
 public List <SkillDTO> ListEmployees()
 {
     using (var context = new WorkScheduleDBContext())
     {
         var result = from Skill in context.Skills
                      orderby Skill.Description
                      where Skill.Description.EndsWith("Journeyman")
                      select new SkillDTO
         {
             Description = Skill.Description,
             Employees   = from EmployeeSkill in Skill.EmployeeSkills
                           orderby EmployeeSkill.YearsOfExperience descending
                           select new EmployeeDTO
             {
                 Name = EmployeeSkill.Employee.FirstName + "  " + EmployeeSkill.Employee.LastName,
                 //Level = EmployeeSkill.Level.ToString(),
                 YearsExperience = EmployeeSkill.YearsOfExperience
             }
         };
         return(result.ToList());
     }
 }
Ejemplo n.º 9
0
 public void AddEmployeeInfo(Employee Entities)
 {
     using (var context = new WorkScheduleDBContext())
     { var adding = context.Employees.Add(Entities); context.SaveChanges(); }
 }
Ejemplo n.º 10
0
 public void AddLocationInfo(Location Entities)
 {
     using (var context = new WorkScheduleDBContext())
     { var adding = context.Locations.Add(Entities); context.SaveChanges(); }
 }
Ejemplo n.º 11
0
 public List <Employee> ListEmployee()
 {
     using (WorkScheduleDBContext EmployeeDBContext = new WorkScheduleDBContext())
     { return(EmployeeDBContext.Employees.ToList()); }
 }