Ejemplo n.º 1
0
        protected void ddlReceiptMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                divlblBalance.Visible = false;
                if (ddlReceiptMode.SelectedValue != "")
                {
                    GeneralLedgerBL   objGeneralLedgerBL = new GeneralLedgerBL();
                    GeneralLedgerBO   objGeneralLedgerBO = new GeneralLedgerBO();
                    ApplicationResult objResultSelect    = new ApplicationResult();
                    DataTable         dtSelect           = new DataTable();

                    if (ddlReceiptMode.SelectedValue == "Cash")
                    {
                        txtChequeNo.Text    = "";
                        txtChequeNo.Enabled = false;
                        ddlGeneralLedger.ClearSelection();

                        objResultSelect = objGeneralLedgerBL.GeneralLedger_Select_Receipt_Payment(1, Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));
                        if (objResultSelect != null)
                        {
                            dtSelect = objResultSelect.resultDT;

                            objControl.BindDropDown_ListBox(dtSelect, ddlGeneralLedger, "AccountName", "LedgerID");
                            ddlGeneralLedger.Items.Insert(0, new ListItem("--Select--", ""));
                        }
                    }
                    else if (ddlReceiptMode.SelectedValue == "Bank")
                    {
                        txtChequeNo.Text    = "";
                        txtChequeNo.Enabled = true;
                        ddlGeneralLedger.ClearSelection();

                        objResultSelect = objGeneralLedgerBL.GeneralLedger_Select_Receipt_Payment(2, Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));
                        if (objResultSelect != null)
                        {
                            dtSelect = objResultSelect.resultDT;

                            objControl.BindDropDown_ListBox(dtSelect, ddlGeneralLedger, "AccountName", "LedgerID");
                            ddlGeneralLedger.Items.Insert(0, new ListItem("--Select--", ""));
                        }
                    }
                    else
                    {
                        txtChequeNo.Text    = "";
                        txtChequeNo.Enabled = true;
                        ddlGeneralLedger.ClearSelection();

                        objResultSelect = objGeneralLedgerBL.GeneralLedger_Select_Receipt_Payment(3, Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));
                        if (objResultSelect != null)
                        {
                            dtSelect = objResultSelect.resultDT;

                            objControl.BindDropDown_ListBox(dtSelect, ddlGeneralLedger, "AccountName", "LedgerID");
                            ddlGeneralLedger.Items.Insert(0, new ListItem("--Select--", ""));
                        }
                    }
                }
                else
                {
                    ddlGeneralLedger.Items.Clear();
                    ddlGeneralLedger.Items.Insert(0, new ListItem("--Select--", ""));
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 2
0
        protected void ddlReceiptMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlReceiptMode.SelectedValue != "")
                {
                    var objGeneralLedgerBl = new GeneralLedgerBL();
                    ApplicationResult objResultSelect;
                    DataTable         dtSelect;

                    switch (ddlReceiptMode.SelectedValue)
                    {
                    case "Cash":
                        ddlGeneralLedger.ClearSelection();
                        objResultSelect = objGeneralLedgerBl.GeneralLedger_Select_Receipt_Payment(1, Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));
                        if (objResultSelect == null)
                        {
                            return;
                        }
                        dtSelect = objResultSelect.resultDT;
                        _objControl.BindDropDown_ListBox(dtSelect, ddlGeneralLedger, "AccountName", "LedgerID");
                        ddlGeneralLedger.Items.Insert(0, new ListItem("--Select--", ""));
                        break;

                    case "Bank":
                        ddlGeneralLedger.ClearSelection();
                        objResultSelect = objGeneralLedgerBl.GeneralLedger_Select_Receipt_Payment(2, Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));
                        if (objResultSelect == null)
                        {
                            return;
                        }
                        dtSelect = objResultSelect.resultDT;
                        _objControl.BindDropDown_ListBox(dtSelect, ddlGeneralLedger, "AccountName", "LedgerID");
                        ddlGeneralLedger.Items.Insert(0, new ListItem("--Select--", ""));
                        break;

                    default:
                        ddlGeneralLedger.ClearSelection();
                        objResultSelect = objGeneralLedgerBl.GeneralLedger_Select_Receipt_Payment(3, Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));
                        if (objResultSelect == null)
                        {
                            return;
                        }
                        dtSelect = objResultSelect.resultDT;
                        _objControl.BindDropDown_ListBox(dtSelect, ddlGeneralLedger, "AccountName", "LedgerID");
                        ddlGeneralLedger.Items.Insert(0, new ListItem("--Select--", ""));
                        break;
                    }
                }
                else
                {
                    ddlGeneralLedger.Items.Clear();
                    ddlGeneralLedger.Items.Insert(0, new ListItem("--Select--", ""));
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }