Exemple #1
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    ShippingRateComputationMethod shippingRateComputationMethod = ShippingRateComputationMethodManager.GetShippingRateComputationMethodByID(this.ShippingRateComputationMethodID);

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

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

                        Response.Redirect("ShippingRateComputationMethodDetails.aspx?ShippingRateComputationMethodID=" + shippingRateComputationMethod.ShippingRateComputationMethodID.ToString());
                    }
                    else
                    {
                        Response.Redirect("ShippingRateComputationMethods.aspx");
                    }
                }
                catch (Exception exc)
                {
                    ProcessException(exc);
                }
            }
        }
 protected void rdbIsDefault_CheckedChanged(object sender, EventArgs e)
 {
     foreach (GridViewRow row in gvShippingRateComputationMethods.Rows)
     {
         RadioButton rdbIsDefault = (RadioButton)row.FindControl("rdbIsDefault");
         HiddenField hfShippingRateComputationMethodID = (HiddenField)row.FindControl("hfShippingRateComputationMethodID");
         int         shippingRateComputationMethodID   = int.Parse(hfShippingRateComputationMethodID.Value);
         if (rdbIsDefault == sender)
         {
             ShippingManager.ActiveShippingRateComputationMethod = ShippingRateComputationMethodManager.GetShippingRateComputationMethodByID(shippingRateComputationMethodID);
         }
     }
     BindGrid();
 }
Exemple #3
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 exc)
                {
                }
            }
        }
Exemple #4
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.txtDisplayOrder.Value         = shippingRateComputationMethod.DisplayOrder;
            }
            else
            {
                Response.Redirect("ShippingRateComputationMethods.aspx");
            }
        }