protected void TxtDiviProdCode_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string TD = BD.GetAccTypeGL(TxtDiviProdCode.Text, Session["BRCD"].ToString());
            if (TD != null)
            {
                string[] TD1 = TD.Split('_');
                if (TD1.Length > 1)
                {
                }
                TxtDiviProdName.Text = TD1[0].ToString();
                ViewState["TGL"]     = TD1[1].ToString();

                TxtDebitPrdCode.Focus();
            }
            else
            {
                WebMsgBox.Show("Invalid product code....!", this.Page);
                TxtDiviProdCode.Text = "";
                TxtDiviProdCode.Focus();
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
    protected void TxtDiviProdName_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string   custno = TxtDiviProdName.Text;
            string[] CT     = custno.Split('_');
            if (CT.Length > 0)
            {
                TxtDiviProdName.Text = CT[0].ToString();
                TxtDiviProdCode.Text = CT[1].ToString();
                string[] GLS = BD.GetAccTypeGL(TxtDiviProdCode.Text, Session["BRCD"].ToString()).Split('_');
                ViewState["DRGL"] = GLS[1].ToString();
                //AutoAccname.ContextKey = Session["BRCD"].ToString() + "_" + TxtProcode.Text + "_" + ViewState["DRGL"].ToString();

                if (TxtDiviProdName.Text == "")
                {
                    WebMsgBox.Show("Please enter valid Product code", this.Page);
                    TxtDiviProdCode.Text = "";
                    TxtDiviProdCode.Focus();
                }
                else
                {
                    TxtDebitPrdCode.Focus();
                }
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
            //Response.Redirect("FrmLogin.aspx", true);
        }
    }
 protected void TxtTAcc_TextChanged(object sender, EventArgs e)
 {
     try
     {
         TxtTAccName.Text = BD.AccName(TxtTAcc.Text, TxtFPRD.Text, TxtFPRD.Text, Session["BRCD"].ToString());
         TxtDiviProdCode.Focus();
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
     }
 }
 protected void Btn_ApplyEntry_Click(object sender, EventArgs e)
 {
     try
     {
         if (TxtDiviProdCode.Text == "" || TxtDiviProdCode.Text == "0")
         {
             WebMsgBox.Show("Enter Dividend Credit Code......!", this);
             TxtDiviProdCode.Text = "";
             TxtDiviProdName.Text = "";
             TxtDiviProdCode.Focus();
             return;
         }
         else if (TxtDebitPrdCode.Text == "" || TxtDebitPrdCode.Text == "0")
         {
             WebMsgBox.Show("Enter Dividend Debit Code......!", this);
             TxtDebitPrdCode.Text = "";
             TxtDebitPrdName.Text = "";
             TxtDebitPrdCode.Focus();
             return;
         }
         else
         {
             STR = DC.PostDividend("POST", DdlCalcType.SelectedValue.ToString(), Session["EntryDate"].ToString(), TxtDiviRate.Text, Session["BRCD"].ToString(), Session["MID"].ToString(), TxtDiviProdCode.Text, TxtDebitPrdCode.Text);
             if (STR != null)
             {
                 WebMsgBox.Show("Dividend posted successfully with Set No - " + STR, this.Page);
                 FL = "Insert";//Dhanya Shetty 23/09/2017
                 string Res = CLM.LOGDETAILS(FL, Session["BRCD"].ToString(), Session["MID"].ToString(), "DivCalc_post" + "_" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString());
                 Clear();
             }
         }
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
     }
 }