private void InitializeViewModel()
		{
			EmployeeID = _deptEmployee.EmployeeID;
			DepartmentID = _deptEmployee.DepartmentID;
			Employee = new EmployeeVM(_deptEmployee.Employee);
			StartDate = _deptEmployee.StartDate;
			EndDate = _deptEmployee.EndDate;
		}
Exemplo n.º 2
0
        public ActionResult Edit(EmployeeVM employeeFromView)
        {
            if (ModelState.IsValid)
            {
				var employee = UnitOfWork.EmployeeRepository.FindById(employeeFromView.ID);

            	employee.Contact.FirstName = employeeFromView.FirstName;
            	employee.Contact.LastName = employeeFromView.LastName;

				UnitOfWork.Commit();
                return RedirectToAction("Index");
            }
        	return View(employeeFromView);
        }