コード例 #1
0
        private AddressRecapViewModel GetAddressRecapViewModel(Address address)
        {
            if (address != null)
            {
                AddressRecapViewModel viewModel = new AddressRecapViewModel
                {
                    City                     = address.City,
                    Company                  = address.Company,
                    CountryName              = this._webStoreServices.StoreContext.AvailableCountries.Where(ac => ac.CountryId == address.CountryId).Select(ac => ac.Name).FirstOrDefault(),
                    DigiCode                 = address.DigiCode,
                    Email                    = address.Email,
                    FaxNumber                = address.FaxNumber,
                    FirstName                = address.FirstName,
                    Floor                    = address.Floor,
                    LastName                 = address.LastName,
                    Line1                    = address.Line1,
                    Line2                    = address.Line2,
                    Line3                    = address.Line3,
                    MiddleName               = address.MiddleName,
                    MobileNumber             = address.MobileNumber,
                    PhoneNumber              = address.PhoneNumber,
                    ZipCode                  = address.ZipCode,
                    ShippingAddressIsTheSame = address == this.RawBillingAddress && !this.ShippingAddressIsDifferent
                };

                if (address.RegionId.HasValue)
                {
                    this._webStoreServices.UsingClient(
                        c => viewModel.RegionName = c.StoreClient.GetRegions(address.CountryId, this._webStoreServices.CurrentCultureId)
                                                    .Where(r => r.RegionId == address.RegionId)
                                                    .Select(r => r.Name)
                                                    .FirstOrDefault()
                        );
                }

                return(viewModel);
            }
            return(null);
        }
コード例 #2
0
 private ActionResult BuildAddressRecapShapeResult(AddressRecapViewModel viewModel)
 {
     return(new ShapePartialResult(this, this._shapeFactory.DisplayTemplate(TemplateName: "Checkout/AddressRecap", Model: viewModel)));
 }