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()); AccountGroupSP spAccountGroup = new AccountGroupSP(); AccountGroupInfo infoAccountGroup = new AccountGroupInfo(); infoAccountGroup = spAccountGroup.AccountGroupView(decAccountGroupId); string strNature = infoAccountGroup.Nature; string strIsAffectGrossProfit = infoAccountGroup.AffectGrossProfit; // string strNature = spAccountGroup.AccountGroupNatureUnderGroup(decAccountGroupId); 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 ex) { formMDI.infoError.ErrorString = "AG24:" + ex.Message; } //if (txtAccountGroupName.Text != null && txtAccountGroupName.Text != string.Empty) //{ //} //else //{ // cmbNature.Enabled = true; //} }
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()); AccountGroupSP spAccountGroup = new AccountGroupSP(); AccountGroupInfo infoAccountGroup = new AccountGroupInfo(); infoAccountGroup = spAccountGroup.AccountGroupView(decAccountGroupId); string strNature = infoAccountGroup.Nature; string strIsAffectGrossProfit = infoAccountGroup.AffectGrossProfit; // string strNature = spAccountGroup.AccountGroupNatureUnderGroup(decAccountGroupId); 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) { } //if (txtAccountGroupName.Text != null && txtAccountGroupName.Text != string.Empty) //{ //} //else //{ // cmbNature.Enabled = true; //} }