コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //
            Taxation cs_tax = StorehouseHelper.GetTaxation(ecPanelRequest.TaxationId);

            //
            if (cs_tax == null)
            {
                RedirectToBrowsePage();
            }
            //
            if (!IsPostBack)
            {
                //
                txtDescription.Text = cs_tax.Description;
                //
                PortalUtils.LoadCountriesDropDownList(ddlCountries, cs_tax.Country);
                //
                LoadCountryStates();
                //
                chkAllStates.Checked = String.Equals(ddlCountries.SelectedValue, TaxationsAddTax.ALL_COUNTRIES);
                chkAllStates.Checked = String.Equals(cs_tax.State, TaxationsAddTax.ALL_STATES);
                if (!chkAllStates.Checked)
                {
                    //
                    if (ddlStates.Visible)
                    {
                        ecUtils.SelectListItem(ddlStates, cs_tax.State);
                    }
                    else
                    {
                        txtStateProvince.Text = cs_tax.State;
                    }
                }
                chkAllStates_CheckedChanged(sender, e);
                //
                txtTaxAmount.Text = cs_tax.Amount.ToString("C");
                //
                rblTaxStatus.SelectedIndex = (cs_tax.Active) ? 0 : 1;
                //
                Utils.SelectListItem(ddlTaxType, cs_tax.TypeId);
                //
                SetTaxAmountValidationType(ddlTaxType.SelectedValue);
            }
        }