Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 2
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);
                }
            }
        }