コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         BD.BindAccStatus(ddlAccStatus);
         autoglname.ContextKey = Session["BRCD"].ToString();
         txtProdType.Focus();
     }
 }
コード例 #2
0
    public void GetVoucherDetails(string SetNo, string Scroll)
    {
        try
        {
            string OpDate = AC.GetFinStartDate(Session["EntryDate"].ToString());
            PayMast = AC.GetPayMast(Session["BRCD"].ToString(), Session["EntryDate"].ToString(), SetNo.ToString(), Scroll.ToString());

            if (PayMast != null)
            {
                DT = AC.GetDetails_ToFill(Session["BRCD"].ToString(), Session["EntryDate"].ToString(), SetNo, PayMast, Scroll);
                if (DT.Rows.Count > 0)
                {
                    txtVoucherNo.Text = SetNo.ToString();
                    txtScrollNo.Text  = Scroll.ToString();
                    BD.BindAccStatus(ddlAccStatus);
                    BD.BindPayment(ddlPayType, "1");
                    hdnamount.Value = VA.GetTotalLoanAmount(SetNo, Session["BRCD"].ToString(), Session["EntryDate"].ToString());//amruta 06-02-2018
                    for (int i = 0; i < DT.Rows.Count; i++)
                    {
                        if (DT.Rows[i]["Parti"].ToString() == "PRNCR")
                        {
                            txtPrinAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "INTCR")
                        {
                            txtIntAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "PENCR")
                        {
                            txtPIntAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "INTRCR")
                        {
                            txtIntRecAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "NOTCR")
                        {
                            txtNotChrgAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "SERCR")
                        {
                            txtSerChrgAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "CRTCR")
                        {
                            txtCrtChrgAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "SURCR")
                        {
                            txtSurChrgAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "OTHCR")
                        {
                            txtOtherChrgAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "BNKCR")
                        {
                            txtBankChrgAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "INSCR")
                        {
                            txtInsuranceAmt.Text = DT.Rows[i]["Amount"].ToString();
                        }

                        if (DT.Rows[i]["Parti"].ToString() == "PAYDR")
                        {
                            string[] PrAcc = DT.Rows[i]["Amount_1"].ToString().Split('/');

                            if (PrAcc.Length > 0)
                            {
                                txtProdType.Text = PrAcc[0].ToString();
                                txtProdName.Text = AC.GetProdName(Session["BRCD"].ToString(), txtProdType.Text.ToString());

                                txtAccNo.Text = PrAcc[1].ToString();
                                DataTable CN = new DataTable();
                                CN = AC.GetCustName(Session["BRCD"].ToString(), txtProdType.Text, txtAccNo.Text);
                                if (CN.Rows.Count > 0)
                                {
                                    string[] CustName = CN.Rows[0]["CustName"].ToString().Split('_');
                                    txtAccName.Text = CustName[0].ToString();
                                    txtCustNo.Text  = CustName[1].ToString();
                                }

                                txtAccStatus.Text          = AC.GetAccStatus(Session["BRCD"].ToString(), txtProdType.Text.Trim().ToString(), txtAccNo.Text.Trim().ToString());
                                ddlAccStatus.SelectedIndex = Convert.ToInt32(txtAccStatus.Text.Trim().ToString());
                                //txtBefClbal.Text = Convert.ToDouble(VA.GetClBal(Session["BRCD"].ToString(), txtProdType.Text.Trim().ToString(), txtAccNo.Text.Trim().ToString(), Session["EntryDate"].ToString(), "ClBal")).ToString();
                                //txtAftClBal.Text = Convert.ToDouble(VA.GetClBal(Session["BRCD"].ToString(), txtProdType.Text.Trim().ToString(), txtAccNo.Text.Trim().ToString(), Session["EntryDate"].ToString(), "MainBal")).ToString();
                                //txtPanNo.Text = PanCard(Session["BRCD"].ToString(), DT.Rows[0]["CustNo"].ToString());
                            }

                            if (DT.Rows[i]["Activity"].ToString() == "3")
                            {
                                ddlPayType.SelectedIndex = Convert.ToInt32(1);
                                txtNarration.Text        = "By Cash";

                                divTransfer.Visible  = false;
                                divInstrment.Visible = false;
                                txtDrAmount.Text     = DT.Rows[i]["Amount"].ToString();
                                //txtPanL.Text = PanCard(Session["BRCD"].ToString(), DT.Rows[0]["CustNo"].ToString());//added by ankita 22/07/2017
                            }
                            else if (DT.Rows[i]["Activity"].ToString() == "7")
                            {
                                ddlPayType.SelectedIndex = Convert.ToInt32(2);
                                txtNarration.Text        = "By TRF";

                                divTransfer.Visible  = true;
                                divInstrment.Visible = false;
                                txtProdType1.Text    = DT.Rows[i]["SubGlCode"].ToString();
                                txtProdName1.Text    = AC.GetProdName(Session["BRCD"].ToString(), txtProdType1.Text.ToString());

                                TxtAccNo1.Text = DT.Rows[i]["AccNo"].ToString();
                                DataTable CN = new DataTable();
                                CN = AC.GetCustName(Session["BRCD"].ToString(), txtProdType1.Text, TxtAccNo1.Text);
                                if (CN.Rows.Count > 0)
                                {
                                    string[] CustName = CN.Rows[0]["CustName"].ToString().Split('_');
                                    TxtAccName1.Text = CustName[0].ToString();
                                }

                                txtDrAmount.Text = DT.Rows[i]["Amount"].ToString();
                                //txtPanL.Text = PanCard(Session["BRCD"].ToString(), DT.Rows[0]["CustNo"].ToString());//added by ankita 22/07/2017
                            }
                            else if (DT.Rows[i]["Activity"].ToString() == "5")
                            {
                                ddlPayType.SelectedIndex = Convert.ToInt32(3);
                                txtNarration.Text        = "By TRF";

                                divTransfer.Visible  = true;
                                divInstrment.Visible = true;
                                txtProdType1.Text    = DT.Rows[i]["SubGlCode"].ToString();
                                txtProdName1.Text    = DT.Rows[i]["GlName"].ToString();
                                TxtAccNo1.Text       = DT.Rows[i]["SubGlCode"].ToString();
                                TxtAccName1.Text     = DT.Rows[i]["GlName"].ToString();
                                TxtInstNo.Text       = DT.Rows[i]["InstrumentNo"].ToString();
                                TxtInstDate.Text     = DT.Rows[i]["InstrumentDate"].ToString();
                                //txtPanL.Text = PanCard(Session["BRCD"].ToString(), DT.Rows[0]["CustNo"].ToString());//added by ankita 22/07/2017
                                txtDrAmount.Text = DT.Rows[i]["Amount"].ToString();
                            }
                        }
                    }

                    ChangeColor();
                    Photo_Sign(Session["BRCD"].ToString(), txtAccNo.Text.Trim().ToString(), txtCustNo.Text.Trim().ToString());
                    AccStat = GetAccStatDetails(Session["BRCD"].ToString(), txtProdType.Text.Trim().ToString(), txtAccNo.Text.Trim().ToString(), OpDate);
                    if (DT.Rows.Count > 0)
                    {
                        grdAccStat.DataSource = DT;
                        grdAccStat.DataBind();
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "ModalView", "<script>$('.bs-example-modal-lg').modal('show');</script>", false);
                    }

                    if (Request.QueryString["Flag"].ToString() == "AT")
                    {
                        txtPassAmount.Focus();
                    }
                    else if (Request.QueryString["Flag"].ToString() == "CN")
                    {
                        ddlReason.Focus();
                    }
                }
                else
                {
                    lblMessage.Text = "Set Not Found...!!";
                    ModalPopup.Show(this.Page);
                    return;
                }
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }