Пример #1
0
        public ActionResult Show(UserAccountOrders page, [IoCModelBinder(typeof(UserAccountOrdersModelBinder))] UserAccountOrdersSearchModel model)
        {
            // check if logged in
            User user = CurrentRequestData.CurrentUser;

            if (user == null)
            {
                return(_uniquePageService.RedirectTo <LoginPage>());
            }

            // Get Orders
            ViewData["orders"] = _getUserOrders.Get(user, model.Page);

            return(View(page));
        }
Пример #2
0
        public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            int pageVal;
            int?page = int.TryParse(GetValueFromContext(controllerContext, "page"), out pageVal)
                ? pageVal
                : (int?)null;

            var model = new UserAccountOrdersSearchModel();

            if (page != null)
            {
                model.Page = page.Value;
            }

            return(model);
        }