Example #1
0
        private void CreateChildControlsTree()
        {
            ShippingRateComputationMethod shippingRateComputationMethod = ShippingRateComputationMethodManager.GetShippingRateComputationMethodById(this.ShippingRateComputationMethodId);

            if (shippingRateComputationMethod != null)
            {
                Control child = null;
                try
                {
                    child = base.LoadControl(shippingRateComputationMethod.ConfigureTemplatePath);
                    this.ConfigurePlaceHolder.Controls.Add(child);
                }
                catch (Exception)
                {
                }
            }
        }
Example #2
0
        private void BindData()
        {
            ShippingRateComputationMethod shippingRateComputationMethod = ShippingRateComputationMethodManager.GetShippingRateComputationMethodById(this.ShippingRateComputationMethodId);

            if (shippingRateComputationMethod != null)
            {
                this.txtName.Text                  = shippingRateComputationMethod.Name;
                this.txtDescription.Text           = shippingRateComputationMethod.Description;
                this.txtConfigureTemplatePath.Text = shippingRateComputationMethod.ConfigureTemplatePath;
                this.txtClassName.Text             = shippingRateComputationMethod.ClassName;
                this.cbActive.Checked              = shippingRateComputationMethod.IsActive;
                this.txtDisplayOrder.Value         = shippingRateComputationMethod.DisplayOrder;
            }
            else
            {
                Response.Redirect("ShippingRateComputationMethods.aspx");
            }
        }
Example #3
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    var shippingRateComputationMethod = ShippingRateComputationMethodManager.GetShippingRateComputationMethodById(this.ShippingRateComputationMethodId);

                    if (shippingRateComputationMethod != null)
                    {
                        shippingRateComputationMethod = ShippingRateComputationMethodManager.UpdateShippingRateComputationMethod(shippingRateComputationMethod.ShippingRateComputationMethodId,
                                                                                                                                 txtName.Text, txtDescription.Text, txtConfigureTemplatePath.Text,
                                                                                                                                 txtClassName.Text, cbActive.Checked, txtDisplayOrder.Value);

                        var configureModule = GetConfigureModule();
                        if (configureModule != null)
                        {
                            configureModule.Save();
                        }

                        CustomerActivityManager.InsertActivity(
                            "EditShippingProvider",
                            GetLocaleResourceString("ActivityLog.EditShippingProvider"),
                            shippingRateComputationMethod.Name);

                        Response.Redirect(string.Format("ShippingRateComputationMethodDetails.aspx?ShippingRateComputationMethodID={0}&TabID={1}", shippingRateComputationMethod.ShippingRateComputationMethodId, this.GetActiveTabId(this.ShippingTabs)));
                    }
                    else
                    {
                        Response.Redirect("ShippingRateComputationMethods.aspx");
                    }
                }
                catch (Exception exc)
                {
                    ProcessException(exc);
                }
            }
        }