示例#1
0
        public PartialViewResult AddNewAddress(string multiShipmentUrl)
        {
            var startPage       = _contentLoader.Get <PageData>(ContentReference.StartPage) as CommerceHomePage;
            var addressBookPage = _contentLoader.Get <PageData>(startPage.AddressBookPage) as AddressBookPage;
            var model           = new AddressViewModel(addressBookPage)
            {
                Address = new AddressModel()
            };

            _addressBookService.LoadAddress(model.Address);
            ViewData["IsInMultiShipment"] = true;
            ViewData["MultiShipmentUrl"]  = multiShipmentUrl;

            return(PartialView("EditAddress", model));
        }
示例#2
0
        public ActionResult EditForm(AddressBookPage currentPage, string addressId)
        {
            var viewModel = new AddressViewModel(currentPage)
            {
                Address = new AddressModel
                {
                    AddressId = addressId,
                },
                CurrentContent = currentPage
            };

            _addressBookService.LoadAddress(viewModel.Address);

            return(AddressEditView(viewModel));
        }
示例#3
0
        public PartialViewResult AddNewAddress(string multiShipmentUrl)
        {
            var referenceSettings = _settingsService.GetSiteSettings <ReferencePageSettings>();
            var addressBookPage   = _contentLoader.Get <PageData>(referenceSettings.AddressBookPage) as AddressBookPage;
            var model             = new AddressViewModel(addressBookPage)
            {
                Address = new AddressModel()
            };

            _addressBookService.LoadAddress(model.Address);
            ViewData["IsInMultiShipment"] = true;
            ViewData["MultiShipmentUrl"]  = multiShipmentUrl;

            return(PartialView("EditAddress", model));
        }
示例#4
0
        public ActionResult OnSaveException(ExceptionContext filterContext)
        {
            var currentPage = filterContext.RequestContext.GetRoutedData <AddressBookPage>();

            var viewModel = new AddressViewModel
            {
                Address = new AddressModel
                {
                    AddressId    = filterContext.HttpContext.Request.Form["addressId"],
                    ErrorMessage = filterContext.Exception.Message,
                },
                CurrentContent = currentPage
            };

            _addressBookService.LoadAddress(viewModel.Address);

            return(AddressEditView(viewModel));
        }