Exemplo n.º 1
0
 protected void TxtProdName_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string   pno = TxtProdName.Text;
         string[] prd = pno.Split('_');
         if (prd.Length > 0)
         {
             TxtProdName.Text = prd[0].ToString();
             TxtProdCde.Text  = prd[1].ToString();
         }
         string GlS1;
         GlS1 = BD.GetAccTypeGL(TxtProdCde.Text, Session["BRCD"].ToString());
         if (GlS1 != null)
         {
             string[] GLS = GlS1.Split('_');
             ViewState["DRGL"]      = GLS[1].ToString();
             autoaccname.ContextKey = Session["BRCD"].ToString() + "_" + TxtProdCde.Text + "_" + ViewState["DRGL"].ToString();
             int GL = 0;
             int.TryParse(ViewState["DRGL"].ToString(), out GL);
         }
     }
     catch (Exception ex)
     {
         ExceptionLogging.SendErrorToText(ex);
     }
 }
 protected void txtLType_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (txtLType.Text == "")
         {
             txtLType.Focus();
             txtLType.Text = "";
         }
         int    result = 0;
         string GlS1;
         int.TryParse(txtLType.Text, out result);
         txtLCode.Text = customcs.GetProductName(result.ToString(), Session["BRCD"].ToString());
         GlS1          = BD.GetAccTypeGL(txtLType.Text, Session["BRCD"].ToString());
         if (GlS1 != null)
         {
             string[] GLS = GlS1.Split('_');
             ViewState["DRGL"] = GLS[1].ToString();
             int GL = 0;
             int.TryParse(ViewState["DRGL"].ToString(), out GL);
             btnReport.Focus();
         }
         else
         {
             WebMsgBox.Show("Enter Valid Product code!....", this.Page);
             txtLType.Text = "";
             txtLCode.Text = "";
             txtLType.Focus();
         }
     }
     catch (Exception eX)
     {
         ExceptionLogging.SendErrorToText(eX);
     }
 }
    public void productcd()
    {
        try
        {
            if (TxtProcode.Text == "")
            {
                TxtProName.Text = "";
                TxtAccNo.Focus();
                goto ext;
            }

            //Added By Amol on 22092017 as per ambika mam instruction
            if (BD.GetProdOperate(Session["BRCD"].ToString(), TxtProcode.Text.Trim().ToString()).ToString() != "3")
            {
                int    result = 0;
                string GlS1;
                int.TryParse(TxtProcode.Text, out result);
                TxtProName.Text = customcs.GetProductName(result.ToString(), Session["BRCD"].ToString());
                GlS1            = BD.GetAccTypeGL(TxtProcode.Text, Session["BRCD"].ToString());
                if (GlS1 != null)
                {
                    string[] GLS = GlS1.Split('_');
                    ViewState["DRGL"]      = GLS[1].ToString();
                    AutoAccname.ContextKey = Session["BRCD"].ToString() + "_" + TxtProcode.Text + "_" + ViewState["DRGL"].ToString();
                    int GL = 0;
                    int.TryParse(ViewState["DRGL"].ToString(), out GL);
                    TxtAccNo.Focus();
                }
                else
                {
                    WebMsgBox.Show("Enter Valid Product code!....", this.Page);
                    TxtProcode.Text = "";
                    TxtProName.Text = "";
                    TxtProcode.Focus();
                }
            }
            else
            {
                TxtProcode.Text = "";
                TxtProName.Text = "";
                lblMessage.Text = "Product is not operating...!!";
                ModalPopup.Show(this.Page);
                return;
            }
            ext :;
        }
        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 txtProdCode_TextChanged(object sender, EventArgs e)
    {
        try
        {
            if (txtProdCode.Text == "")
            {
                txtProdCode.Text = "";
                goto ext;
            }
            int    result = 0;
            string GlS1;
            int.TryParse(txtProdCode.Text, out result);
            txtProdName.Text = customcs.GetProductName(result.ToString(), Session["BRCD"].ToString());
            GlS1             = BD.GetAccTypeGL(txtProdCode.Text, Session["BRCD"].ToString());
            if (GlS1 != null)
            {
                string[] GLS = GlS1.Split('_');
                ViewState["DRGL"] = GLS[1].ToString();
                int GL = 0;
                int.TryParse(ViewState["DRGL"].ToString(), out GL);
                if (txtBranchCode.Text == "")
                {
                    AutoCompleteExtender2.ContextKey = Session["BRCD"].ToString() + "_" + txtProdCode.Text;
                    Flag.Value = "0";
                    BRCD.Value = Session["BRCD"].ToString();
                }
                else
                {
                    AutoCompleteExtender2.ContextKey = txtBranchCode.Text + "_" + txtProdCode.Text;
                    Flag.Value = "1";
                    BRCD.Value = txtBranchCode.Text;
                }
            }
            else
            {
                WebMsgBox.Show("Enter Valid Product code!....", this.Page);
                txtProdCode.Text = "";
                txtProdCode.Focus();
                Flag.Value = "0";
                BRCD.Value = Session["BRCD"].ToString();
            }


            ext :;
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
    //protected void txtIntAccNo_TextChanged(object sender, EventArgs e)
    //{
    //    try
    //    {
    //        string AT = "";
    //        AT = BD.Getstage1(txtIntAccNo.Text, Session["BRCD"].ToString(), txtIntProdCode.Text);
    //        if (AT != null)
    //        {
    //            if (AT != "1003")
    //            {
    //                lblMessage.Text = "Sorry Customer not Authorise...!!";
    //                ModalPopup.Show(this.Page);

    //                //txtIntAccNo.Text = "";
    //                //txtIntAccName.Text = "";

    //               // txtIntAccNo.Focus();
    //                return;
    //            }
    //            else
    //            {
    //                DT = new DataTable();
    //                DT = ICR.GetCustName(txtIntProdCode.Text, txtIntAccNo.Text, Session["BRCD"].ToString());
    //                if (DT.Rows.Count > 0)
    //                {
    //                    string[] CustName = DT.Rows[0]["CustName"].ToString().Split('_');
    //                    txtIntAccName.Text = CustName[0].ToString();
    //                }

    //                txtPrinProdCode.Focus();
    //            }
    //        }
    //        else
    //        {
    //            lblMessage.Text = "Enter valid account number...!!";
    //            ModalPopup.Show(this.Page);

    //            txtIntAccNo.Text = "";
    //            txtIntAccName.Text = "";

    //            txtIntAccNo.Focus();
    //            return;
    //        }
    //    }
    //    catch (Exception Ex)
    //    {
    //        ExceptionLogging.SendErrorToText(Ex);
    //    }
    //}
    //protected void txtIntAccName_TextChanged(object sender, EventArgs e)
    //{
    //    try
    //    {
    //        string CUNAME = txtIntAccName.Text;
    //        string[] custnob = CUNAME.Split('_');
    //        if (custnob.Length > 1)
    //        {
    //            txtIntAccName.Text = custnob[0].ToString();
    //            txtIntAccNo.Text = (string.IsNullOrEmpty(custnob[1].ToString()) ? "" : custnob[1].ToString());

    //            txtPrinProdCode.Focus();
    //        }
    //    }
    //    catch (Exception Ex)
    //    {
    //        ExceptionLogging.SendErrorToText(Ex);
    //    }
    //}

    protected void txtPCode_TextChanged(object sender, EventArgs e)
    {
        try
        {
            if (txtPCode.Text == "")
            {
                txtPCode.Text = "";
                txtBankNo.Focus();
                goto ext;
            }
            int    result = 0;
            string GlS1;
            int.TryParse(txtPCode.Text, out result);
            txtPType.Text = customcs.GetProductName(result.ToString(), Session["BRCD"].ToString());
            GlS1          = BD.GetAccTypeGL(txtPCode.Text, Session["BRCD"].ToString());
            if (GlS1 != null)
            {
                string[] GLS = GlS1.Split('_');
                ViewState["DRGL"] = GLS[1].ToString();
                int GL = 0;
                int.TryParse(ViewState["DRGL"].ToString(), out GL);
                //txtBankNo1.Focus();

                txtBResNo.Text    = Convert.ToInt32(IAM.GetBoardResNo(Session["BRCD"].ToString())).ToString();
                txtAccNo.Text     = Convert.ToInt32(IAM.GetNextReceiptNo(Session["BRCD"].ToString(), txtPCode.Text.Trim().ToString())).ToString();
                txtReceiptNo.Text = Convert.ToInt32(IAM.GetReceiptNo(txtPCode.Text.Trim().ToString())).ToString();
                txtBankName1.Focus();
            }
            else
            {
                WebMsgBox.Show("Enter Valid Product code!....", this.Page);
                txtPCode.Text = "";
                txtPCode.Focus();
            }


            ext :;
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
    protected void TxtAccType_TextChanged(object sender, EventArgs e)
    {
        try
        {
            if (TxtAccType.Text == "")
            {
                TxtAcctypeName.Text = "";
                TxtAccNo.Focus();
                goto ext;
            }
            int    result = 0;
            string GlS1;
            int.TryParse(TxtAccType.Text, out result);
            TxtAcctypeName.Text = customcs.GetProductName(result.ToString(), Session["BRCD"].ToString());
            GlS1 = BD.GetAccTypeGL(TxtAccType.Text, Session["BRCD"].ToString());
            if (GlS1 != null)
            {
                string[] GLS = GlS1.Split('_');
                ViewState["GL"]        = GLS[1].ToString();
                AutoAccname.ContextKey = Session["BRCD"].ToString() + "_" + TxtAccType.Text + "_" + ViewState["GL"].ToString();
                int GL = 0;
                int.TryParse(ViewState["GL"].ToString(), out GL);
                TxtAccNo.Focus();
            }
            else
            {
                WebMsgBox.Show("Enter Valid Product code!....", this.Page);
                TxtAccType.Text     = "";
                TxtAcctypeName.Text = "";
                TxtAccType.Focus();
            }

            ext :;
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
            //Response.Redirect("FrmLogin.aspx", true);
        }
    }
Exemplo n.º 8
0
 protected void TxtProdCde_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string tds = BD.GetLoanGL(TxtProdCde.Text, Session["BRCD"].ToString());
         if (tds != null)
         {
             string[] TD = tds.Split('_');
             if (TD.Length > 0)
             {
             }
             string GlS1;
             TxtProdName.Text = TD[0].ToString();
             TxtProdCde.Text  = TD[1].ToString();
             GlS1             = BD.GetAccTypeGL(TxtProdCde.Text, Session["BRCD"].ToString());
             if (GlS1 != null)
             {
                 string[] GLS = GlS1.Split('_');
                 ViewState["DRGL"]      = GLS[1].ToString();
                 autoaccname.ContextKey = Session["BRCD"].ToString() + "_" + TxtProdCde.Text + "_" + ViewState["DRGL"].ToString();
                 int GL = 0;
                 int.TryParse(ViewState["DRGL"].ToString(), out GL);
             }
             TxtAccno.Focus();
         }
         else
         {
             WebMsgBox.Show("Invalid Deposit Code......!", this.Page);
             TxtProdName.Text = "";
             TxtProdCde.Text  = "";
             return;
         }
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
     }
 }