protected void TxtAccno_TextChanged(object sender, EventArgs e)
    {
        try
        {
            if (TxtBRCD.Text != "")
            {
                string AT = "";
                // AT = BD.GetStage1(TxtAccno.Text, Session["BRCD"].ToString(), ViewState["Flag"].ToString());
                AT = BD.Getstage1(TxtAccno.Text, TxtBRCD.Text, TxtAccType.Text);
                if (AT != "1003")
                {
                    lblMessage.Text = "Sorry Customer not Authorise.........!!";
                    ModalPopup.Show(this.Page);
                    TxtAccHName.Text = "";
                    TxtAccno.Text    = "";
                    TxtAccno.Focus();
                }
                else
                {
                    DataTable DT = new DataTable();
                    DT = AST.GetCustName(TxtAccType.Text, TxtAccno.Text, TxtBRCD.Text);
                    if (DT.Rows.Count > 0)
                    {
                        string[] TD = TxtTDate.Text.Split('/');
                        TxtAccHName.Text = DT.Rows[0]["CustName"].ToString();
                        TxtOPDT.Text     = Convert.ToDateTime(DT.Rows[0]["OPENINGDATE"]).ToString("dd/MM/yyyy");
                        //--Abhishek
                        string RES = AST.GetAccStatus(TxtBRCD.Text, TxtAccno.Text, TxtAccType.Text);
                        if (RES == "1")
                        {
                            TxtACStatus.Text = "Active";
                        }
                        else if (RES == "9")
                        {
                            TxtACStatus.Text = "Suit File";
                        }
                        else
                        {
                            TxtACStatus.Text = "Deactive";
                        }
                        TxtClearBal.Text   = OC.GetOpenClose("CLOSING", TD[2].ToString(), TD[1].ToString(), TxtAccType.Text, TxtAccno.Text, Session["BRCD"].ToString(), Session["EntryDate"].ToString(), ViewState["GL"].ToString()).ToString();
                        TxtUnClearBal.Text = OC.GetOpenClose("Unclear", TD[2].ToString(), TD[1].ToString(), TxtAccType.Text, TxtAccno.Text, Session["BRCD"].ToString(), Session["EntryDate"].ToString(), ViewState["GL"].ToString()).ToString();
                    }

                    TxtFDate.Focus();
                }
            }
            else
            {
                WebMsgBox.Show("Enter Branch Code First....!", this.Page);
                TxtAccno.Text = "";
                TxtBRCD.Focus();
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
            //Response.Redirect("FrmLogin.aspx", true);
        }
    }
Esempio n. 2
0
 protected void TxtAccHName_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string   CUNAME  = TxtAccHName.Text;
         string[] custnob = CUNAME.Split('_');
         if (custnob.Length > 1)
         {
             TxtAccHName.Text = custnob[0].ToString();
             TxtAccno.Text    = (string.IsNullOrEmpty(custnob[1].ToString()) ? "" : custnob[1].ToString());
             //--Abhishek
             string RES = AST.GetAccStatus(TxtBRCD.Text, TxtAccno.Text, TxtAccType.Text);
             Btn_View.Focus();
         }
         else
         {
             lblMessage.Text = "Invalid Account Number.........!!";
             ModalPopup.Show(this.Page);
             return;
         }
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
         //Response.Redirect("FrmLogin.aspx", true);
     }
 }
    public Double GetBalance(string SubGlCode, string Accno, string BRCD)
    {
        string ToDate = "";

        ToDate = Session["EntryDate"].ToString();
        try
        {
            DataTable DT = new DataTable();
            DT = AST.GetCustName(SubGlCode, Accno, BRCD);
            if (DT.Rows.Count > 0)
            {
                string[] TD = ToDate.Split('/');

                string[] GL = BD.GetAccTypeGL(SubGlCode, BRCD).Split('_');
                //TxtATName.Text = GL[0].ToString();
                ViewState["GL"] = GL[1].ToString();

                //--Abhishek
                string RES = AST.GetAccStatus(BRCD, Accno, SubGlCode);
                Balance = OC.GetOpenClose("CLOSING", TD[2].ToString(), TD[1].ToString(), SubGlCode, Accno.ToString(), Session["BRCD"].ToString(), Session["EntryDate"].ToString(), ViewState["GL"].ToString());
            }
        }
        catch (Exception Ex)
        {
            Balance = 0.0F;
            ExceptionLogging.SendErrorToText(Ex);
        }
        return(Balance);
    }
 protected void TxtAccno_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (TxtBRCD.Text != "")
         {
             string AT = "";
             // AT = BD.GetStage1(TxtAccno.Text, Session["BRCD"].ToString(), ViewState["Flag"].ToString());
             AT = BD.Getstage1(TxtAccno.Text, TxtBRCD.Text, TxtAccType.Text);
             if (AT != "1003")
             {
                 lblMessage.Text = "Sorry Customer not Authorise.........!!";
                 ModalPopup.Show(this.Page);
                 TxtAccHName.Text = "";
                 TxtAccno.Text    = "";
                 TxtAccno.Focus();
             }
             else
             {
                 DataTable DT = new DataTable();
                 DT = AST.GetCustName(TxtAccType.Text, TxtAccno.Text, TxtBRCD.Text);
                 if (DT.Rows.Count > 0)
                 {
                     TxtAccHName.Text = DT.Rows[0]["CustName"].ToString();
                     //--Abhishek
                     string RES = AST.GetAccStatus(TxtBRCD.Text, TxtAccno.Text, TxtAccType.Text);
                 }
             }
         }
         else
         {
             WebMsgBox.Show("Enter Branch Code First....!", this.Page);
             TxtAccno.Text = "";
             TxtBRCD.Focus();
         }
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
         //Response.Redirect("FrmLogin.aspx", true);
     }
 }