Esempio n. 1
0
        public EmployeeEditViewModel Add(EmployeeEditViewModel EmployeeEditViewModel)
        {
            Employee Employee = EmployeeRepo.Add(EmployeeEditViewModel.ToModel());

            unitOfWork.commit();
            return(Employee.ToEditableViewModel());
        }
Esempio n. 2
0
        public EmployeeEditViewModel Update(EmployeeEditViewModel EmployeeEditViewModel)
        {
            Employee employee  = EmployeeEditViewModel.ToModel();
            Employee _Employee = EmployeeRepo.Update(employee);

            UserRepo.Update(employee.User);
            EmployeeAddressRepo.Update(employee.EmployeeAddresses.FirstOrDefault());
            unitOfWork.commit();
            return(_Employee.ToEditableViewModel());
        }