Esempio n. 1
0
        public List <EmployeeDataContract> GetAllEmployee()
        {
            var employees = new List <Employees>();

            employees = context.Employees.ToList();
            var employeesContract = new List <EmployeeDataContract>();
            EmployeeDataContract empContract;

            foreach (var emp in employees)
            {
                empContract = new EmployeeDataContract()
                {
                    FirstName = emp.FirstName,
                    Gender    = emp.Gender,
                    Id        = emp.Id,
                    LastName  = emp.LastName,
                    Salary    = emp.Salary
                };
                employeesContract.Add(empContract);
            }
            return(employeesContract);
        }
 public bool DeleteEmployee(EmployeeDataContract employee)
 {
     repository.DeleteEmployee(employee);
     return(true);
 }
 public bool UpdateEmmployee(EmployeeDataContract employee)
 {
     repository.UpdateEmployee(employee);
     return(true);
 }
 public bool AddEmployee(EmployeeDataContract employee)
 {
     repository.AddEmployee(employee);
     return(true);
 }