public ActionResult Edit(EmployeeModel employeeModel, FormCollection collection) { if (ModelState.IsValid) { IList <CodeMessage> messages = new List <CodeMessage>(); this._userManagementRepository.EmployeeUpdate(PresentationMapper.ToEntity(employeeModel), out messages); return(RedirectToAction(pmsVariable.ControllerActionString.Notification, pmsVariable.ControllerString.Common, new { id = "3" })); } else { employeeModel.StaffId = int.Parse(((LoginModel)Session[pmsVariable.SessioKey.LoginCredential]).EmployeeId).ToString(); employeeModel.LoadList(_lookupServiceRepository); employeeModel.PersonModel.LoadList(_lookupServiceRepository); return(View(employeeModel)); } }
public ActionResult Create(PersonModel person, FormCollection collection) { if (ModelState.IsValid) { IList <CodeMessage> messages = new List <CodeMessage>(); //this._userManagementRepository.ServiceHeaders = PresentationUtility.GetBasicHeaders(new string[] { pmsVariable.ServiceHeaderKey.EmployeeId, pmsVariable.ServiceHeaderKey.UserName, pmsVariable.ServiceHeaderKey.Email }); this._userManagementRepository.PersonInsert(PresentationMapper.ToEntity(person), out messages); return(RedirectToAction(pmsVariable.ControllerActionString.Notification, pmsVariable.ControllerString.Common, new { id = "1" })); } else { person.LoadList(_lookupServiceRepository); return(View(person)); } }