Exemplo n.º 1
0
        private void SaveData()
        {
            ShippingMethod.Name           = this.NameField.Text.Trim();
            ShippingMethod.ZoneId         = long.Parse(this.lstZones.SelectedItem.Value);
            ShippingMethod.AdjustmentType = (ShippingMethodAdjustmentType)int.Parse(AdjustmentDropDownList.SelectedValue);
            ShippingMethod.Adjustment     = decimal.Parse(AdjustmentTextBox.Text, System.Globalization.NumberStyles.Currency);

            // Global Settings
            MyPage.MTApp.CurrentStore.Settings.ShippingUSPostalDiagnostics = this.Diagnostics.Checked;

            // Method Settings
            USPostalServiceSettings Settings = new USPostalServiceSettings();

            Settings.Merge(ShippingMethod.Settings);

            // Service Code
            List <MerchantTribe.Shipping.IServiceCode> filter = new List <MerchantTribe.Shipping.IServiceCode>();

            foreach (ListItem item in ShippingTypesCheckBoxList.Items)
            {
                if (item.Selected)
                {
                    MerchantTribe.Shipping.ServiceCode code = new MerchantTribe.Shipping.ServiceCode()
                    {
                        Code = item.Value, DisplayName = item.Text
                    };
                    filter.Add(code);
                }
            }
            Settings.ServiceCodeFilter = filter;

            ShippingMethod.Settings.Merge(Settings);

            MyPage.MTApp.UpdateCurrentStore();
        }
Exemplo n.º 2
0
        private void SaveData()
        {
            ShippingMethod.Name           = this.NameField.Text.Trim();
            ShippingMethod.ZoneId         = long.Parse(this.lstZones.SelectedItem.Value);
            ShippingMethod.AdjustmentType = (ShippingMethodAdjustmentType)int.Parse(AdjustmentDropDownList.SelectedValue);
            ShippingMethod.Adjustment     = decimal.Parse(AdjustmentTextBox.Text, System.Globalization.NumberStyles.Currency);

            // Global Settings
            MyPage.MTApp.CurrentStore.Settings.ShippingUSPostalDiagnostics = this.Diagnostics.Checked;
            MyPage.MTApp.AccountServices.Stores.Update(MyPage.MTApp.CurrentStore);

            // Method Settings
            USPostalServiceSettings Settings = new USPostalServiceSettings();

            Settings.Merge(ShippingMethod.Settings);

            // Service Code
            List <MerchantTribe.Shipping.IServiceCode> filter = new List <MerchantTribe.Shipping.IServiceCode>();

            foreach (ListItem item in ShippingTypesCheckBoxList.Items)
            {
                if (item.Selected)
                {
                    MerchantTribe.Shipping.ServiceCode code = new MerchantTribe.Shipping.ServiceCode()
                    {
                        Code = item.Value, DisplayName = item.Text
                    };
                    filter.Add(code);
                }
            }
            Settings.ServiceCodeFilter = filter;
            Settings["highlight"]      = this.lstHighlights.SelectedValue;

            // Package
            string packageCode    = this.lstPackageType.SelectedItem.Value;
            int    packageCodeInt = -1;

            if (int.TryParse(packageCode, out packageCodeInt))
            {
                Settings.PackageType = (MerchantTribe.Shipping.USPostal.v4.DomesticPackageType)packageCodeInt;
            }


            ShippingMethod.Settings.Merge(Settings);
        }
Exemplo n.º 3
0
        private void SaveData()
        {
            ShippingMethod.Name = this.NameField.Text.Trim();
            ShippingMethod.ZoneId = long.Parse(this.lstZones.SelectedItem.Value);
            ShippingMethod.AdjustmentType = (ShippingMethodAdjustmentType)int.Parse(AdjustmentDropDownList.SelectedValue);
            ShippingMethod.Adjustment = decimal.Parse(AdjustmentTextBox.Text, System.Globalization.NumberStyles.Currency);

            // Global Settings
            MyPage.MTApp.CurrentStore.Settings.ShippingUSPostalDiagnostics = this.Diagnostics.Checked;

            // Method Settings
            USPostalServiceSettings Settings = new USPostalServiceSettings();
            Settings.Merge(ShippingMethod.Settings);

            // Service Code
            List<MerchantTribe.Shipping.IServiceCode> filter = new List<MerchantTribe.Shipping.IServiceCode>();
                foreach (ListItem item in ShippingTypesCheckBoxList.Items)
                {
                    if (item.Selected)
                    {
                        MerchantTribe.Shipping.ServiceCode code = new MerchantTribe.Shipping.ServiceCode() { Code = item.Value, DisplayName = item.Text };
                        filter.Add(code);
                    }
                }
            Settings.ServiceCodeFilter = filter;

            ShippingMethod.Settings.Merge(Settings);

            MyPage.MTApp.UpdateCurrentStore();
        }
Exemplo n.º 4
0
        private void SaveData()
        {
            ShippingMethod.Name = this.NameField.Text.Trim();
            ShippingMethod.ZoneId = long.Parse(this.lstZones.SelectedItem.Value);
            ShippingMethod.AdjustmentType = (ShippingMethodAdjustmentType)int.Parse(AdjustmentDropDownList.SelectedValue);
            ShippingMethod.Adjustment = decimal.Parse(AdjustmentTextBox.Text, System.Globalization.NumberStyles.Currency);

            // Global Settings
            MyPage.MTApp.CurrentStore.Settings.ShippingUSPostalDiagnostics = this.Diagnostics.Checked;
            MyPage.MTApp.AccountServices.Stores.Update(MyPage.MTApp.CurrentStore);
            
            // Method Settings
            USPostalServiceSettings Settings = new USPostalServiceSettings();
            Settings.Merge(ShippingMethod.Settings);

            // Service Code
            List<MerchantTribe.Shipping.IServiceCode> filter = new List<MerchantTribe.Shipping.IServiceCode>();
                foreach (ListItem item in ShippingTypesCheckBoxList.Items)
                {
                    if (item.Selected)
                    {
                        MerchantTribe.Shipping.ServiceCode code = new MerchantTribe.Shipping.ServiceCode() { Code = item.Value, DisplayName = item.Text };
                        filter.Add(code);
                    }
                }
            Settings.ServiceCodeFilter = filter;
            Settings["highlight"] = this.lstHighlights.SelectedValue;

            // Package
            string packageCode = this.lstPackageType.SelectedItem.Value;
            int packageCodeInt = -1;
            if (int.TryParse(packageCode, out packageCodeInt))
            {
                Settings.PackageType = (MerchantTribe.Shipping.USPostal.v4.DomesticPackageType)packageCodeInt;
            }


            ShippingMethod.Settings.Merge(Settings);
        }