public ActionResult Create(JobHistoryForm jobHistoryForm) { var vm = new JobHistoryViewModel(jobHistoryForm); if (!ModelState.IsValid) { return View(vm); } var cmdResult = ExecuteCommand(new CreateJobHistoryCommand(jobHistoryForm)); if (cmdResult.Success) return RedirectToAction("ShowJobHistory", new {employeeId = cmdResult.Result}); return View(vm); }
public ActionResult ShowJobHistory(Guid employeeId) { var vm = new JobHistoryViewModel(Query(new GetJobHistoryQuery(employeeId))); return View(vm); }
public ActionResult Create() { var positions = Query(new GetPositionQuery()); var vm = new JobHistoryViewModel(positions); return View(vm); }