コード例 #1
0
        // protected int UserEnquiryId => ApplicationUser?.EnquiryId?? 0;

        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            var viewModel = filterContext.Controller.ViewData.Model as BaseViewModel;

            if (viewModel != null)
            {
                var organisation = UserManager.TenantOrganisation;
                viewModel.OrganisationName = organisation?.Name ?? string.Empty;
                viewModel.CentreName       = EgharpayBusinessService.RetrieveCentre(UserOrganisationId, UserCentreId, e => true)?.Name ?? viewModel.OrganisationName;
                viewModel.PersonnelId      = UserPersonnelId;
                viewModel.CentreId         = UserCentreId;
                // viewModel.EnquiryId = UserEnquiryId;
            }

            base.OnActionExecuted(filterContext);
        }
コード例 #2
0
        // GET: Centre/Edit/{id}
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var centre = EgharpayBusinessService.RetrieveCentre(UserOrganisationId, id.Value);

            if (centre == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new CentreViewModel
            {
                Centre = centre
            };

            return(View(viewModel));
        }