public IActionResult AddStaffDetail() { var userDetail = HttpContext.Session .GetObjectFromJson <AccountDetailView>("AccountDetailView").UserDetail; if (UserType.STAFF != userDetail.UserType) { return(RedirectToAction("AddSupplierDetail")); } var viewModel = new StaffDetailView(); return(View(viewModel)); }
public IActionResult SaveStaffDetail(StaffDetailView viewModel) { var accountModel = HttpContext.Session .GetObjectFromJson <AccountDetailView>("AccountDetailView"); if (accountModel.UserDetail == null) { accountModel.StaffDetail = new StaffDetailView(); } accountModel.StaffDetail = viewModel; HttpContext.Session.SetObjectAsJson("AccountDetailView", accountModel); return(RedirectToAction("AddSupplierDetail")); }