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); } } }
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(); }
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) { } } }
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"); } }