Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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"));
        }