Пример #1
0
 private CheckoutView MapDataCheckoutTypeToheckoutView(CheckoutType checkoutType)
 {
     return(new CheckoutView
     {
         CheckoutId = checkoutType.Id,
         CheckoutName = checkoutType.Name
     });
 }
Пример #2
0
 /// <summary>
 /// Creates a new instance of a CheckoutOptions object with the initial values specified.
 /// This object will be u
 /// </summary>
 /// <param name="sellerCode"></param>
 /// <param name="merchantOrderId"></param>
 /// <param name="process"></param>
 /// <param name="useSandBox"></param>
 /// <param name="expiresInDays"></param>
 /// <param name="successReturn"></param>
 /// <param name="cancelReturn"></param>
 /// <param name="ipnUrl"></param>
 /// <param name="failureUrl"></param>
 public CheckoutOptions(string sellerCode, string merchantOrderId = "", CheckoutType process = CheckoutType.Express, bool useSandBox = false, int?expiresInDays = null, string successReturn = "", string cancelReturn = "", string ipnUrl = "", string failureUrl = "")
 {
     UseSandbox    = useSandBox;
     Process       = process;
     SellerCode    = sellerCode;
     SuccessReturn = successReturn;
     CancelReturn  = cancelReturn;
     IpnUrlReturn  = ipnUrl;
     FailureReturn = failureUrl;
     ExpiresInDays = expiresInDays;
     OrderId       = merchantOrderId;
 }
Пример #3
0
        private void LoadCheckoutType(CheckoutType checkoutMode)
        {
            ListItem registred  = new ListItem(Localization.GetString("CheckoutModeRegistred", LocalResourceFile), ((int)CheckoutType.Registred).ToString(CultureInfo.InvariantCulture));
            ListItem userchoice = new ListItem(Localization.GetString("CheckoutModeUserChoice", LocalResourceFile), ((int)CheckoutType.UserChoice).ToString(CultureInfo.InvariantCulture));
            ListItem anonymous  = new ListItem(Localization.GetString("CheckoutModeAnonymous", LocalResourceFile), ((int)CheckoutType.Anonymous).ToString(CultureInfo.InvariantCulture));

            lstCheckoutMode.Items.Add(registred);
            lstCheckoutMode.Items.Add(userchoice);
            lstCheckoutMode.Items.Add(anonymous);
            ListItem selected = lstCheckoutMode.Items.FindByValue(((int)checkoutMode).ToString(CultureInfo.InvariantCulture));

            if (selected != null)
            {
                selected.Selected = true;
            }
        }
Пример #4
0
 public void Fill(System.Data.IDataReader dr)
 {
     _portalID             = Convert.ToInt32(dr["PortalID"]);
     _name                 = Convert.ToString(Null.SetNull(dr["Name"], _name));
     _description          = Convert.ToString(Null.SetNull(dr["Description"], _description));
     _keywords             = Convert.ToString(Null.SetNull(dr["Keywords"], _keywords));
     _seoFeature           = Convert.ToBoolean(dr["SEOFeature"]);
     _gatewayName          = Convert.ToString(dr["GatewayName"]);
     _gatewaySettings      = Convert.ToString(Null.SetNull(dr["GatewaySettings"], _gatewaySettings));
     _defaultEmailAddress  = Convert.ToString(Null.SetNull(dr["DefaultEmailAddress"], _defaultEmailAddress));
     _shoppingCartPageID   = Convert.ToInt32(Null.SetNull(dr["ShoppingCartPageID"], _shoppingCartPageID));
     _createdByUser        = Convert.ToString(dr["CreatedByUser"]);
     _createdDate          = Convert.ToDateTime(dr["CreatedDate"]);
     _storePageID          = Convert.ToInt32(Null.SetNull(dr["StorePageID"], _storePageID));
     _currencySymbol       = Convert.ToString(Null.SetNull(dr["CurrencySymbol"], _currencySymbol));
     _portalTemplates      = Convert.ToBoolean(dr["PortalTemplates"]);
     _styleSheet           = Convert.ToString(Null.SetNull(dr["StyleSheet"], _styleSheet));
     _authorizeCancel      = Convert.ToBoolean(dr["AuthorizeCancel"]);
     _inventoryManagement  = Convert.ToBoolean(dr["InventoryManagement"]);
     _outOfStock           = Convert.ToInt32(dr["OutOfStock"]);
     _productsBehavior     = Convert.ToInt32(dr["ProductsBehavior"]);
     _avoidNegativeStock   = Convert.ToBoolean(dr["AvoidNegativeStock"]);
     _orderRoleID          = Convert.ToInt32(dr["OrderRoleID"]);
     _catalogRoleID        = Convert.ToInt32(dr["CatalogRoleID"]);
     _secureCookie         = Convert.ToBoolean(dr["SecureCookie"]);
     _checkoutMode         = (CheckoutType)(dr["CheckoutMode"]);
     _impersonatedUserID   = Convert.ToInt32(Null.SetNull(dr["ImpersonatedUserID"], _impersonatedUserID));
     _noDelivery           = Convert.ToBoolean(dr["NoDelivery"]);
     _allowVirtualProducts = Convert.ToBoolean(dr["AllowVirtualProducts"]);
     _allowCoupons         = Convert.ToBoolean(dr["AllowCoupons"]);
     _allowFreeShipping    = Convert.ToBoolean(dr["AllowFreeShipping"]);
     _minOrderAmount       = Convert.ToDecimal(Null.SetNull(dr["MinOrderAmount"], _minOrderAmount));
     _restrictToCountries  = Convert.ToBoolean(dr["RestrictToCountries"]);
     _authorizedCountries  = Convert.ToString(Null.SetNull(dr["AuthorizedCountries"], _authorizedCountries));
     _onOrderPaidRoleID    = Convert.ToInt32(dr["OnOrderPaidRoleID"]);
     _taxName              = Convert.ToString(dr["TaxName"]);
     _shippingName         = Convert.ToString(dr["ShippingName"]);
     _addressName          = Convert.ToString(dr["AddressName"]);
 }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _hostTemplatesFolder   = MapPath(ControlPath) + "Templates";
            _portalTemplatesFolder = PortalSettings.HomeDirectoryMapPath + "Store\\Templates";
            if (!IsPostBack)
            {
                string       storePageID        = null;
                string       cartPageID         = null;
                int          outOfStock         = Null.NullInteger;
                int          productBehavior    = Null.NullInteger;
                int          orderRoleID        = Null.NullInteger;
                int          catalogRoleID      = Null.NullInteger;
                CheckoutType checkoutMode       = CheckoutType.Registred;
                int          impersonatedUserID = Null.NullInteger;
                int          onOrderPaidRoleID  = Null.NullInteger;
                string       gatewayName        = "EmailProvider";
                string       addressName        = "Default";
                string       taxName            = "Default";
                string       shippingName       = "Default";
                bool         isSettingsExist    = StoreSettings != null;

                if (isSettingsExist)
                {
                    txtStoreName.Text   = StoreSettings.Name;
                    txtDescription.Text = StoreSettings.Description;
                    txtKeywords.Text    = StoreSettings.Keywords;
                    if (StoreSettings.SEOFeature)
                    {
                        chkSEOFeature.Checked = true;
                    }
                    else
                    {
                        trDescription.Visible = false;
                        trKeywords.Visible    = false;
                    }
                    txtEmail.Text                 = StoreSettings.DefaultEmailAddress;
                    txtCurrencySymbol.Text        = StoreSettings.CurrencySymbol;
                    chkUsePortalTemplates.Checked = StoreSettings.PortalTemplates;
                    storePageID = StoreSettings.StorePageID.ToString(CultureInfo.InvariantCulture);
                    cartPageID  = StoreSettings.ShoppingCartPageID.ToString(CultureInfo.InvariantCulture);
                    chkAuthorizeCancel.Checked     = StoreSettings.AuthorizeCancel;
                    chkInventoryManagement.Checked = StoreSettings.InventoryManagement;
                    if (!StoreSettings.InventoryManagement)
                    {
                        trOutOfStock.Visible         = false;
                        trProductsBehavior.Visible   = false;
                        trAvoidNegativeStock.Visible = false;
                    }
                    outOfStock      = StoreSettings.OutOfStock;
                    productBehavior = StoreSettings.ProductsBehavior;
                    chkAvoidNegativeStock.Checked = StoreSettings.AvoidNegativeStock;
                    orderRoleID   = StoreSettings.OrderRoleID;
                    catalogRoleID = StoreSettings.CatalogRoleID;
                    if (!StoreSettings.SecureCookie && !SymmetricHelper.CanSafelyEncrypt)
                    {
                        rowSecureCookie.Visible = false;
                    }
                    chkSecureCookie.Checked = StoreSettings.SecureCookie;
                    checkoutMode            = StoreSettings.CheckoutMode;
                    impersonatedUserID      = StoreSettings.ImpersonatedUserID;
                    chkNoDelivery.Checked   = StoreSettings.NoDelivery;
                    if (chkNoDelivery.Checked)
                    {
                        trShippingProviderSelection.Visible = false;
                        plhShippingProvider.Visible         = false;
                        trFreeShipping.Visible = false;
                    }
                    chkAllowVirtualProducts.Checked = StoreSettings.AllowVirtualProducts;
                    chkAllowCoupons.Checked         = StoreSettings.AllowCoupons;
                    gatewayName = StoreSettings.GatewayName;
                    addressName = StoreSettings.AddressName;
                    taxName     = StoreSettings.TaxName;
                    if (!chkNoDelivery.Checked)
                    {
                        shippingName = StoreSettings.ShippingName;
                    }
                    chkAllowFreeShipping.Checked = StoreSettings.AllowFreeShipping;
                    trFreeShipping.Visible       = chkAllowFreeShipping.Checked;
                    decimal minOrderAmount = StoreSettings.MinOrderAmount;
                    if (minOrderAmount == Null.NullDecimal)
                    {
                        minOrderAmount = 0;
                    }
                    txtMinOrderAmount.Text         = minOrderAmount.ToString("0.00");
                    chkRestrictToCountries.Checked = StoreSettings.RestrictToCountries;
                    trAuthorizedCountries.Visible  = chkRestrictToCountries.Checked;
                    FillAuthorizedCountries(StoreSettings.AuthorizedCountries);
                    onOrderPaidRoleID   = StoreSettings.OnOrderPaidRoleID;
                    trProviders.Visible = false;
                }
                else
                {
                    trDescription.Visible         = false;
                    trKeywords.Visible            = false;
                    trOutOfStock.Visible          = false;
                    trProductsBehavior.Visible    = false;
                    trAvoidNegativeStock.Visible  = false;
                    trFreeShipping.Visible        = false;
                    trAuthorizedCountries.Visible = false;
                    FillAuthorizedCountries("");
                    plhAddressProvider.Visible  = false;
                    plhTaxProvider.Visible      = false;
                    plhShippingProvider.Visible = false;
                }
                // Load available style sheet
                LoadStyleSheet(chkUsePortalTemplates.Checked);
                // Load available tabs to host:
                // - the catalog module
                // - the account module
                LoadTabs(storePageID, cartPageID);
                // Load Out Of Stock messages and Products Behavior
                LoadOutOfStockMessages(outOfStock, productBehavior);
                // Load portal roles
                LoadManagerRoles(orderRoleID, catalogRoleID);
                // Load checkout types
                LoadCheckoutType(checkoutMode);
                // Define Mode Interface
                DefineModeUI(lstCheckoutMode.SelectedIndex, impersonatedUserID);
                // Load order roles
                LoadOrderRoles(onOrderPaidRoleID);
                // Load available gateway providers
                LoadGatewayProviders(gatewayName);
                // Load available address providers
                LoadAddressProviders(addressName);
                // Load available tax providers
                LoadTaxProviders(taxName);
                // Load available shipping providers
                LoadShippingProviders(shippingName);
            }

            // Load gateway admin control
            LoadGatewayAdmin(lstGateway.SelectedItem.Text);
            // Load address admin control
            LoadAddressAdmin(lstAddressProviders.SelectedValue);
            // Load tax admin control
            LoadTaxAdmin(lstTaxProviders.SelectedValue);
            // Load shipping admin control
            LoadShippingAdmin(lstShippingProviders.SelectedValue);
        }
Пример #6
0
 public CheckoutOptions()
 {
     UseSandbox = false;
     Process    = CheckoutType.Express;
 }