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
        protected void Page_Load(object sender, EventArgs e)
        {
            // LOCATE THE SHIP GATEWAY INFORMATION
            string classId = Misc.GetClassId(typeof(AustraliaPost));
            IList <ShipGateway> gateways = ShipGatewayDataSource.LoadForClassId(classId);

            if (gateways.Count == 0)
            {
                Response.Redirect("Register.aspx");
            }
            _ShipGateway = gateways[0];

            // INITIALIZE THE PROVIDER SHIP METHOD CONTROL
            ShipMethods.ShipGatewayId = _ShipGateway.Id;

            // INITIALIZE THE FORM FIELDS ON FIRST VISIT
            if (!Page.IsPostBack)
            {
                AustraliaPost provider = (AustraliaPost)_ShipGateway.GetProviderInstance();
                UseDebugMode.Checked    = provider.UseDebugMode;
                EnablePackaging.Checked = provider.EnablePackageBreakup;
                MaxWeight.Text          = provider.MaxPackageWeight.ToString();
                MinWeight.Text          = provider.MinPackageWeight.ToString();
            }
        }
Example #3
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();
        }