protected void TxtTPName_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string   custno = TxtTPName.Text;
            string[] CT     = custno.Split('_');
            if (CT.Length > 0)
            {
                TxtTPName.Text   = CT[0].ToString();
                TxtTProcode.Text = CT[1].ToString();
                //TxtGLCD.Text = CT[2].ToString();
                string[] GLS = BD.GetAccTypeGL(TxtTProcode.Text, Session["BRCD"].ToString()).Split('_');
                ViewState["DRGL"]       = GLS[1].ToString();
                AutoTAccName.ContextKey = Session["BRCD"].ToString() + "_" + TxtTProcode.Text + "_" + ViewState["DRGL"].ToString();

                int GL = 0;
                int.TryParse(ViewState["DRGL"].ToString(), out GL);
                TxtTAccno.Focus();
                if (TxtTPName.Text == "")
                {
                    WebMsgBox.Show("Please enter valid Product code", this.Page);
                    TxtTProcode.Text = "";
                    TxtTProcode.Focus();
                }
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
            //Response.Redirect("FrmLogin.aspx", true);
        }
    }
    protected void TxtTProcode_TextChanged(object sender, EventArgs e)
    {
        try
        {
            if (TxtTProcode.Text == "")
            {
                TxtTPName.Text = "";
                TxtTAccno.Focus();
                goto ext;
            }
            int    result = 0;
            string GlS1;
            string CHK = BD.GetGlDetails(Session["BRCD"].ToString(), TxtTProcode.Text, TxtTAccno.Text, "CHEQUE");
            if (CHK == null && Ddl_type.SelectedIndex == 2)
            {
                WebMsgBox.Show("Product Code is Not in CBB Group!.....", this.Page);
                TxtTProcode.Text = "";
                TxtTPName.Text   = "";
                TxtTProcode.Focus();
                return;
            }

            else
            {
                int.TryParse(TxtTProcode.Text, out result);
                TxtTPName.Text = customcs.GetProductName(result.ToString(), Session["BRCD"].ToString());
                GlS1           = BD.GetAccTypeGL(TxtTProcode.Text, Session["BRCD"].ToString());
                if (GlS1 != null)
                {
                    string[] GLS = GlS1.Split('_');
                    ViewState["DRGL"]       = GLS[1].ToString();
                    AutoTAccName.ContextKey = Session["BRCD"].ToString() + "_" + TxtTProcode.Text + "_" + ViewState["DRGL"].ToString();
                    int GL = 0;
                    int.TryParse(ViewState["DRGL"].ToString(), out GL);
                    TxtTAccno.Focus();
                }
                else
                {
                    WebMsgBox.Show("Enter Valid Product code!....", this.Page);
                    TxtTProcode.Text = "";
                    TxtTPName.Text   = "";
                    TxtTProcode.Focus();
                }
            }
            ext :;
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
            //Response.Redirect("FrmLogin.aspx", true);
        }
    }
    protected void TxtTAccName_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string   CUNAME  = TxtTAccName.Text;
            string[] custnob = CUNAME.Split('_');
            if (custnob.Length > 1)
            {
                TxtTAccName.Text = custnob[0].ToString();
                TxtTAccno.Text   = (string.IsNullOrEmpty(custnob[1].ToString()) ? "" : custnob[1].ToString());

                string[] TD = Session["EntryDate"].ToString().Split('/');

                if (TxtTAccno.Text == "")
                {
                    TxtTAccName.Text = "";
                    return;
                }
                Btn_Submit.Focus();
            }
            else
            {
                lblMessage.Text = "";
                lblMessage.Text = "Invalid Account Number.........!!";
                ModalPopup.Show(this.Page);
                TxtTAccno.Text   = "";
                TxtTAccName.Text = "";
                TxtTAccno.Focus();
                return;
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
            //Response.Redirect("FrmLogin.aspx", true);
        }
    }
    protected void TxtTAccno_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string AT   = "";
            string ACST = "";
            ACST = OC.GETACCStatus(Session["BRCD"].ToString(), TxtTAccno.Text, TxtTProcode.Text);
            if (ACST != "3")
            {
                AT = BD.Getstage1(TxtTAccno.Text, Session["BRCD"].ToString(), TxtTProcode.Text);
                if (AT != null)
                {
                    if (AT != "1003")
                    {
                        lblMessage.Text = "Sorry Customer not Authorise.........!!";
                        ModalPopup.Show(this.Page);
                        //  Clear();
                    }
                    else
                    {
                        string[] TD = Session["EntryDate"].ToString().Split('/');

                        if (TxtTAccno.Text == "")
                        {
                            TxtTAccName.Text = "";
                            goto ext;
                        }

                        DataTable dt1 = new DataTable();
                        if (TxtTAccno.Text != "" & TxtTProcode.Text != "")
                        {
                            string   PRD = "";
                            string[] CN;
                            PRD = TxtTProcode.Text;
                            CN  = customcs.GetAccountName(TxtTAccno.Text.ToString(), PRD, Session["BRCD"].ToString()).Split('_');
                            ViewState["CUSTNO"] = CN[0].ToString();

                            TxtTAccName.Text = CN[1].ToString();

                            if (TxtTAccName.Text == "" & TxtTAccno.Text != "")
                            {
                                WebMsgBox.Show("Please enter valid Account number", this.Page);
                                TxtTAccno.Text = "";
                                TxtTAccno.Focus();
                                return;
                            }
                            Btn_Submit.Focus();
                        }

                        if (TxtTAccno.Text == "" || TxtTProcode.Text == "")
                        {
                            TxtTAccName.Text = "";
                            goto ext;
                        }
                        dt1 = customcs.GetAccNoAccType(TxtTProcode.Text, TxtTAccno.Text, Session["BRCD"].ToString());

                        if (dt1 != null && dt1.Rows.Count != 0)
                        {
                        }
                        else
                        {
                        }
                        ext :;
                    }
                }
                else
                {
                    WebMsgBox.Show("Enter Valid Account number!...", this.Page);
                    TxtTAccno.Text = "";
                    TxtTAccno.Focus();
                }
            }
            else
            {
                WebMsgBox.Show("Account already closed!...", this.Page);
                Clear();
            }
        }

        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
            //Response.Redirect("FrmLogin.aspx", true);
        }
    }