protected void ddlState_SelectedIndexChanged(object sender, EventArgs e) { if (US51.GetState(ddlState.SelectedValue)[Salary] < 0) { MsgBox(ddlState.SelectedItem + "'s tax rates are unknown, using 0%", this.Page, this); } //Only update state info, not federal tax txtStateTax.Text = (GetTax() * 100).ToString() + "%"; }
private double GetTax() => (US51.GetState(ddlState.SelectedValue)[Salary] < 0)? 0 : (US51.GetState(ddlState.SelectedValue)[Salary]);