コード例 #1
0
        public ActionResult Edit(AddressModel model)
        {
            if (!ModelState.IsValid)
            {
                return(CurrentUmbracoPage());
            }

            Customer.SaveCustomerAddress(model.ToCustomerAddress());

            return(View(model));
        }
コード例 #2
0
        public ActionResult DummyAddresses()
        {
            /* TODO: Needed some duff data, this does the trick nicely, needs removing though */
            if (!Customer.Addresses.Any())
            {
                var home = new AddressModel(Customer.Key)
                {
                    Alias       = "Home",
                    Fullname    = "Cheryl Wallace",
                    Address1    = "5555 Anywhere St",
                    Address2    = "",
                    City        = "Bellingham",
                    Region      = "WA",
                    PostalCode  = "98225",
                    CountryCode = "US",
                    Phone       = "(360) 867-5309",
                    IsExpressCheckoutEnabled = true
                };

                var work = new AddressModel(Customer.Key)
                {
                    Alias       = "Work",
                    Fullname    = "Cheryl Wallace",
                    Address1    = "222 Anywhere St",
                    Address2    = "Suite 22",
                    City        = "Bellingham",
                    Region      = "WA",
                    CountryCode = "US",
                    PostalCode  = "98226",
                    Phone       = "(360) 867-5310",
                    IsExpressCheckoutEnabled = false
                };

                Customer.SaveCustomerAddress(home.ToCustomerAddress());
                Customer.SaveCustomerAddress(work.ToCustomerAddress());
            }

            return(RedirectToAction("Index"));
        }