示例#1
0
 private IEnumerable<Country> GetAvailableCountries()
 {
     WebStoreConfigurationPart configuration = this._webStoreConfigurationServices.GetConfiguration();
     WebStoreServices webStoreServices = new WebStoreServices(configuration);
     IEnumerable<Country> availableCountries = webStoreServices.CreateWebStoreChannel<IProfileService>().GetCountries(new GetCountriesParameters { MerchantId = configuration.MerchantId.Value, CultureName = Thread.CurrentThread.CurrentUICulture.Name }).OrderBy(c => c.DisplayName);
     webStoreServices.Dispose();
     return availableCountries;
 }
示例#2
0
 public ActionResult ShippingMethods()
 {
     WebStoreConfigurationPart configuration = this._webStoreConfigurationServices.GetConfiguration();
     WebStoreServices webStoreServices = new WebStoreServices(configuration);
     Basket basket = this._basketServices.GetBasket();
     ShippingMethodsViewModel viewModel = new ShippingMethodsViewModel { AvailableShippingMethods = webStoreServices.CreateWebStoreChannel<IOrderService>().GetShippingMethods(new GetShippingMethodsParameters { BasketId = this._basketServices.GetBasketId().Value, CultureName = Thread.CurrentThread.CurrentUICulture.Name, MerchantId = configuration.MerchantId.Value, UserId = this._webstoreProfileServices.GetUser() }), Currency = basket.Currency, ShippingMethod = basket.OrderFormHeaders.First().LineItems.First().ShippingMethodId.ToString() };
     webStoreServices.Dispose();
     this.Response.Cache.SetCacheability(HttpCacheability.NoCache);
     return this.View("~/Modules/WebStore/Views/Order/ShippingMethods.cshtml", viewModel);
 }
示例#3
0
 private IEnumerable<Merchant> GetMerchantSettings(String servicesPath)
 {
     WebStoreServices webstoreServices = new WebStoreServices(servicesPath);
     IEnumerable<Merchant> merchants = webstoreServices.CreateWebStoreChannel<IProfileService>().GetMerchants().OrderBy(m => m.Name);
     webstoreServices.Dispose();
     return merchants;
 }
示例#4
0
 public ActionResult ShippingMethods(ShippingMethodsViewModel viewModel)
 {
     WebStoreServices webStoreServices = new WebStoreServices(this._webStoreConfigurationServices.GetConfiguration());
     if (this.ModelState.IsValid)
     {
         IOrderService orderServices = webStoreServices.CreateWebStoreChannel<IOrderService>();
         orderServices.UpdateBasket(
             new UpdateBasketParameters
             {
                 BasketId = this._basketServices.GetBasketId().Value,
                 UserId = this._webstoreProfileServices.GetUser(),
                 ShippingMethodId = Guid.Parse(viewModel.ShippingMethod),
                 CultureName = Thread.CurrentThread.CurrentUICulture.Name,
                 CountryId = this.BillingAddress.ShippingAddressIsDifferent ? this.ShippingAddress.Country : this.BillingAddress.Country
             }
         );
         webStoreServices.Dispose();
         Basket b = this._basketServices.GetBasket();
         return this.View("~/Modules/WebStore/Views/Order/Pay.cshtml", new PayViewModel { Total = b.Total, ShippingCost = b.ShippingTotal, SubTotal = b.SubTotal, Currency = b.Currency });
     }
     else
     {
         viewModel.AvailableShippingMethods = webStoreServices.CreateWebStoreChannel<IOrderService>().GetShippingMethods(new GetShippingMethodsParameters { BasketId = this._basketServices.GetBasketId().Value, CultureName = Thread.CurrentThread.CurrentUICulture.Name, MerchantId = this._webStoreConfigurationServices.GetConfiguration().MerchantId.Value, UserId = this._webstoreProfileServices.GetUser() });
         webStoreServices.Dispose();
     }
     return this.View(viewModel);
 }
示例#5
0
 private IEnumerable<Catalog> GetCatalogsSettings(String servicesPath, Guid merchantId)
 {
     WebStoreServices webstoreServices = new WebStoreServices(servicesPath);
     IEnumerable<Catalog> catalogs = webstoreServices.CreateWebStoreChannel<ICatalogService>().GetCatalogs(new GetCatalogsParameters { CultureName = "en-US", MerchantId = merchantId }).Where(c => c.IsActive).OrderBy(c => c.Name);
     webstoreServices.Dispose();
     return catalogs;
 }