コード例 #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 rdbIsDefault_CheckedChanged(object sender, EventArgs e)
 {
     foreach (GridViewRow row in gvTaxProviders.Rows)
     {
         RadioButton rdbIsDefault    = (RadioButton)row.FindControl("rdbIsDefault");
         HiddenField hfTaxProviderID = (HiddenField)row.FindControl("hfTaxProviderID");
         int         taxProviderID   = int.Parse(hfTaxProviderID.Value);
         if (rdbIsDefault == sender)
         {
             TaxManager.ActiveTaxProvider = TaxProviderManager.GetTaxProviderByID(taxProviderID);
         }
     }
     BindGrid();
 }
コード例 #3
0
        private void CreateChildControlsTree()
        {
            TaxProvider taxProvider = TaxProviderManager.GetTaxProviderByID(this.TaxProviderID);

            if (taxProvider != null)
            {
                Control child = null;
                try
                {
                    child = base.LoadControl(taxProvider.ConfigureTemplatePath);
                    this.ConfigurePlaceHolder.Controls.Add(child);
                }
                catch (Exception exc)
                {
                }
            }
        }
コード例 #4
0
        private void BindData()
        {
            TaxProvider taxProvider = TaxProviderManager.GetTaxProviderByID(this.TaxProviderID);

            if (taxProvider != null)
            {
                this.txtName.Text                  = taxProvider.Name;
                this.txtDescription.Text           = taxProvider.Description;
                this.txtConfigureTemplatePath.Text = taxProvider.ConfigureTemplatePath;
                this.txtClassName.Text             = taxProvider.ClassName;
                this.txtDisplayOrder.Value         = taxProvider.DisplayOrder;
            }
            else
            {
                Response.Redirect("TaxProviders.aspx");
            }
        }