コード例 #1
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    TaxProvider taxProvider = TaxProviderManager.GetTaxProviderByID(this.TaxProviderID);

                    if (taxProvider != null)
                    {
                        taxProvider = TaxProviderManager.UpdateTaxProvider(taxProvider.TaxProviderID, txtName.Text,
                                                                           txtDescription.Text, txtConfigureTemplatePath.Text, txtClassName.Text,
                                                                           txtDisplayOrder.Value);

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

                        Response.Redirect("TaxProviderDetails.aspx?TaxProviderID=" + taxProvider.TaxProviderID.ToString());
                    }
                    else
                    {
                        Response.Redirect("TaxProviders.aspx");
                    }
                }
                catch (Exception exc)
                {
                    ProcessException(exc);
                }
            }
        }
コード例 #2
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    var taxProvider = TaxProviderManager.GetTaxProviderById(this.TaxProviderId);

                    if (taxProvider != null)
                    {
                        taxProvider = TaxProviderManager.UpdateTaxProvider(taxProvider.TaxProviderId, txtName.Text,
                                                                           txtDescription.Text, txtConfigureTemplatePath.Text, txtClassName.Text,
                                                                           txtDisplayOrder.Value);

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

                        CustomerActivityManager.InsertActivity(
                            "EditTaxProvider",
                            GetLocaleResourceString("ActivityLog.EditTaxProvider"),
                            taxProvider.Name);

                        Response.Redirect(string.Format("TaxProviderDetails.aspx?TaxProviderID={0}&TabID={1}", taxProvider.TaxProviderId, this.GetActiveTabId(this.TaxTabs)));
                    }
                    else
                    {
                        Response.Redirect("TaxProviders.aspx");
                    }
                }
                catch (Exception exc)
                {
                    ProcessException(exc);
                }
            }
        }