protected void LoadChartOfAccountsCashHeadList() { ChartOfAccountBLL chartOfAccount = new ChartOfAccountBLL(); try { DataTable dt = chartOfAccount.GetActiveAndPostedChartOfAccountsCashHeadList(); cashAccountHeadDropDownList.DataSource = dt; cashAccountHeadDropDownList.DataValueField = "AccountId"; cashAccountHeadDropDownList.DataTextField = "AccountHead"; cashAccountHeadDropDownList.DataBind(); cashAccountHeadDropDownList.Items.Insert(0, ""); cashAccountHeadDropDownList.SelectedIndex = 0; if (dt.Rows.Count < 1) { msgbox.Visible = true; msgTitleLabel.Text = "Cash Account Head Data Not Found!!!"; msgDetailLabel.Text = ""; msgbox.Attributes.Add("class", "alert alert-warning"); } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } finally { chartOfAccount = null; } }
protected void paymentModeDropDownList_SelectedIndexChanged(object sender, EventArgs e) { try { accountHeadDropDownList.Items.Clear(); ChartOfAccountBLL chartOfAccount = new ChartOfAccountBLL(); if (paymentModeDropDownList.SelectedItem.Text == "Cash") { DataTable dt = chartOfAccount.GetActiveAndPostedChartOfAccountsCashHeadList(); accountHeadDropDownList.DataSource = dt; accountHeadDropDownList.DataValueField = "AccountId"; accountHeadDropDownList.DataTextField = "AccountHead"; accountHeadDropDownList.DataBind(); accountHeadDropDownList.Items.Insert(0, ""); accountHeadDropDownList.SelectedIndex = 0; } else if (paymentModeDropDownList.SelectedItem.Text == "Cheque") { DataTable dt = chartOfAccount.GetActiveAndPostedChartOfAccountsBankHeadList(); accountHeadDropDownList.DataSource = dt; accountHeadDropDownList.DataValueField = "AccountId"; accountHeadDropDownList.DataTextField = "AccountHead"; accountHeadDropDownList.DataBind(); accountHeadDropDownList.Items.Insert(0, ""); accountHeadDropDownList.SelectedIndex = 0; } } catch (Exception) { throw; } }