public async Task <IActionResult> Edit(int personId) { var pers = await _proxy.GetPersonById(personId); var model = Mapper.Map <PersonViewModel>(pers); model.ModelPurpose = ViewModelPurpose.Edit; return(View("Edit", model)); }
public async Task <IActionResult> Create(int personId) { var emp = new Employment(); var model = Mapper.Map <EmploymentViewModel>(emp); var pers = await _proxy.GetPersonById(personId); model.PersonId = pers.PersonId; model.EmployeeNum = pers.EmployeeNum; model.EmployedDate = null; model.ModelPurpose = ViewModelPurpose.Create; return(View("_EmploymentForm", model)); }