private void cmbGroupUnder_SelectedIndexChanged(object sender, EventArgs e) { try { if (cmbGroupUnder.SelectedValue != null && cmbGroupUnder.SelectedValue.ToString() != "System.Data.DataRowView") { decimal decAccountGroupId = Convert.ToDecimal(cmbGroupUnder.SelectedValue.ToString()); AccountGroupBll bllAccountGroup = new AccountGroupBll(); AccountGroupInfo infoAccountGroup = new AccountGroupInfo(); infoAccountGroup = bllAccountGroup.AccountGroupView(decAccountGroupId); string strNature = infoAccountGroup.Nature; string strIsAffectGrossProfit = infoAccountGroup.AffectGrossProfit; if (strNature != "NA") { cmbNature.Text = strNature; if (infoAccountGroup.AffectGrossProfit == "1") { cmbAffectGrossProfit.SelectedIndex = 0; } else { cmbAffectGrossProfit.SelectedIndex = 1; } cmbNature.Enabled = false; cmbAffectGrossProfit.Enabled = false; } else { cmbNature.Enabled = true; cmbAffectGrossProfit.Enabled = true; } } } catch (Exception) { } }