Example #1
0
        protected void RegisterButton_Click(object sender, System.EventArgs e)
        {
            // make sure conditions appear for store
            Store  store      = AbleContext.Current.Store;
            string conditions = store.Settings.CheckoutTermsAndConditions;

            if (string.IsNullOrEmpty(conditions))
            {
                conditions = ConditionText.Text;
            }
            else
            {
                if (!conditions.Contains(ConditionText.Text))
                {
                    conditions += "\r\n\r\n<p>" + ConditionText.Text + "</p>";
                }
            }
            store.Settings.CheckoutTermsAndConditions = conditions;
            store.Save();

            AustraliaPost provider = new AustraliaPost();

            provider.AccountActive = true;
            ShipGateway gateway = new ShipGateway();

            gateway.Name    = provider.Name;
            gateway.ClassId = Misc.GetClassId(provider.GetType());
            gateway.UpdateConfigData(provider.GetConfigData());
            gateway.Enabled = true;
            gateway.Save();
            Response.Redirect("Configure.aspx?ShipGatewayId=" + gateway.Id.ToString());
        }
Example #2
0
        private void SaveShipGateWay()
        {
            AustraliaPost provider = (AustraliaPost)_ShipGateway.GetProviderInstance();

            provider.UseDebugMode         = UseDebugMode.Checked;
            provider.EnablePackageBreakup = EnablePackaging.Checked;
            provider.MaxPackageWeight     = AlwaysConvert.ToDecimal(MaxWeight.Text, (decimal)provider.MaxPackageWeight);
            provider.MinPackageWeight     = AlwaysConvert.ToDecimal(MinWeight.Text, (decimal)provider.MinPackageWeight);
            _ShipGateway.UpdateConfigData(provider.GetConfigData());
            _ShipGateway.Save();
        }