예제 #1
0
 protected void ddlActivity_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (ddlPMTMode.SelectedValue == "3")
         {
             TxtNarration.Focus();
         }
         if (ddlPMTMode.SelectedValue == "7")
         {
             if (ddlActivity.SelectedValue == "1")
             {
                 DivBranch.Visible = true;
                 ddlLoanBrName.Focus();
             }
             else if (ddlActivity.SelectedValue == "2")
             {
                 txtLoanBrCode.Text      = Session["BRCD"].ToString();
                 ViewState["LoanBrCode"] = Session["BRCD"].ToString();
                 DivBranch.Visible       = false;
                 TxtPtype.Focus();
             }
         }
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
     }
 }
예제 #2
0
    protected void TxtCustName_TextChanged(object sender, EventArgs e)
    {
        string[] TD = TxtCustName.Text.Split('_');
        if (TD.Length > 1)
        {
            TxtCustName.Text = TD[0].ToString();
            TxtAccNo.Text    = TD[1].ToString();
            txtCustNo.Text   = TD[2].ToString();

            if (Convert.ToInt32(txtCustNo.Text.Trim().ToString() == "" ? "0" : txtCustNo.Text.Trim().ToString()) < 0)
            {
                TxtAccNo.Text    = "";
                TxtCustName.Text = "";
                txtCustNo.Text   = "";
                TxtBalance.Text  = "";
                TxtTotalBal.Text = "";
                TxtAccNo.Focus();
                WebMsgBox.Show("Please Enter valid Account Number Customer Not Exist...!!", this.Page);
                return;
            }

            TxtBalance.Text  = MV.GetOpenClose(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString(), TxtAccNo.Text.Trim().ToString(), Session["EntryDate"].ToString(), "ClBal").ToString();
            TxtTotalBal.Text = MV.GetOpenClose(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString(), TxtAccNo.Text.Trim().ToString(), Session["EntryDate"].ToString(), "MainBal").ToString();

            if (TxtAccNo.Text != "" && TxtPtype.Text != "")
            {
                DataTable dtmodal = new DataTable();
                string    sql1    = "EXEC A_VOUCHINFO 'MODAL','" + TxtPtype.Text + "','" + ViewState["LoanBrCode"].ToString() + "','" + conn.ConvertDate(Session["ENTRYDATE"].ToString()) + "','" + TxtAccNo.Text + "'";
                dtmodal = conn.GetDatatable(sql1);
                if (dtmodal.Rows.Count > 0)
                {
                    resultout = CR.GetInfo(GrdView, ViewState["LoanBrCode"].ToString(), Session["ENTRYDATE"].ToString(), TxtAccNo.Text, TxtPtype.Text);
                    if (resultout > 0)
                    {
                        string Modal_Flag            = "VOUCHERVIEW";
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();

                        sb.Append(@"<script type='text/javascript'>");
                        sb.Append("$('#" + Modal_Flag + "').modal('show');");
                        sb.Append(@"</script>");

                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddShowModalScript", sb.ToString(), false);
                    }
                }
            }
            TxtNarration.Focus();
        }
        else
        {
            lblMessage.Text = "Enter Valid Account Number...!!";
            ModalPopup.Show(this.Page);
            TxtAccNo.Text    = "";
            TxtCustName.Text = "";
            txtCustNo.Text   = "";
            TxtBalance.Text  = "";
            TxtTotalBal.Text = "";
            TxtAccNo.Focus();
        }
    }
예제 #3
0
    protected void TxtPname_TextChanged(object sender, EventArgs e)
    {
        string[] TD = TxtPname.Text.Split('_');
        if (TD.Length > 1)
        {
            TxtPname.Text = TD[0].ToString();
            TxtPtype.Text = TD[1].ToString();

            string[] AC = MV.Getaccno(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString()).Split('_');
            ViewState["GlCode"]    = AC[0].ToString();
            AutoAccname.ContextKey = ViewState["LoanBrCode"].ToString() + "_" + TxtPtype.Text;

            string YN = CC.GetIntACCYN(ViewState["LoanBrCode"].ToString(), TxtPtype.Text);
            if (Convert.ToInt32(ViewState["GlCode"].ToString() == "" ? "0" : ViewState["GlCode"].ToString()) >= 100 && YN != "Y")
            {
                TxtAccNo.Text    = "";
                TxtCustName.Text = "";
                txtCustNo.Text   = "";
                TxtBalance.Text  = "";
                TxtTotalBal.Text = "";

                TxtAccNo.Text    = TxtPtype.Text.ToString();
                TxtCustName.Text = TxtPname.Text.ToString();
                txtCustNo.Text   = "0";

                string[] DTE = Session["EntryDate"].ToString().Split('/');
                TxtBalance.Text  = OC.GetOpenClose("CLOSING", DTE[2].ToString(), DTE[1].ToString(), TxtPtype.Text.Trim().ToString(), "0", Session["BRCD"].ToString(), Session["EntryDate"].ToString(), ViewState["GlCode"].ToString()).ToString();
                TxtTotalBal.Text = OC.GetOpenClose("MAIN_CLOSING", DTE[2].ToString(), DTE[1].ToString(), TxtPtype.Text.Trim().ToString(), "0", Session["BRCD"].ToString(), Session["EntryDate"].ToString(), ViewState["GlCode"].ToString()).ToString();

                //TxtBalance.Text = MV.GetOpenClose(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString(), "0", Session["EntryDate"].ToString(), "ClBal").ToString();
                //TxtTotalBal.Text = MV.GetOpenClose(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString(), "0", Session["EntryDate"].ToString(), "MainBal").ToString();

                TxtNarration.Focus();
            }
            else
            {
                TxtAccNo.Text    = "";
                TxtCustName.Text = "";
                TxtBalance.Text  = "";
                TxtTotalBal.Text = "";
                hdfGlCode.Value  = Convert.ToInt32(ViewState["GlCode"].ToString() == "" ? "0" : ViewState["GlCode"].ToString()).ToString();

                TxtAccNo.Focus();
            }
        }
        else
        {
            lblMessage.Text = "Enter Valid Product code...!!";
            ModalPopup.Show(this.Page);
            ClearText();
            TxtPtype.Focus();
        }
    }
예제 #4
0
    protected void TxtAccNo_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string AT = "";

            AT = BD.Getstage1(TxtAccNo.Text, ViewState["LoanBrCode"].ToString(), TxtPtype.Text);
            if (AT != null)
            {
                if (AT != "1003")
                {
                    lblMessage.Text = "Sorry Customer not Authorise...!!";
                    ModalPopup.Show(this.Page);
                    TxtAccNo.Text    = "";
                    TxtCustName.Text = "";
                    txtCustNo.Text   = "";
                    TxtBalance.Text  = "";
                    TxtTotalBal.Text = "";
                    TxtAccNo.Focus();
                }
                else
                {
                    DataTable DT = new DataTable();
                    DT = MV.GetCustName(TxtPtype.Text, TxtAccNo.Text, ViewState["LoanBrCode"].ToString());
                    if (DT.Rows.Count > 0)
                    {
                        string[] CustName = DT.Rows[0]["CustName"].ToString().Split('_');

                        TxtCustName.Text = CustName[0].ToString();
                        txtCustNo.Text   = CustName[1].ToString();

                        if (Convert.ToInt32(txtCustNo.Text.Trim().ToString() == "" ? "0" : txtCustNo.Text.Trim().ToString()) < 0)
                        {
                            TxtAccNo.Text    = "";
                            TxtCustName.Text = "";
                            txtCustNo.Text   = "";
                            TxtBalance.Text  = "";
                            TxtTotalBal.Text = "";
                            TxtAccNo.Focus();
                            WebMsgBox.Show("Please Enter valid Account Number Customer Not Exist...!!", this.Page);
                            return;
                        }

                        TxtBalance.Text  = MV.GetOpenClose(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString(), TxtAccNo.Text.Trim().ToString(), Session["EntryDate"].ToString(), "ClBal").ToString();
                        TxtTotalBal.Text = MV.GetOpenClose(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString(), TxtAccNo.Text.Trim().ToString(), Session["EntryDate"].ToString(), "MainBal").ToString();

                        DebitAmt = MV.DebitAmount(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString(), TxtAccNo.Text.Trim().ToString(), Session["EntryDate"].ToString(), Session["Mid"].ToString());
                        if (DebitAmt.ToString() != "")
                        {
                            TxtBalance.Text = (Convert.ToDouble(TxtBalance.Text) - Convert.ToDouble(DebitAmt)).ToString();
                        }

                        TxtNarration.Focus();
                    }
                    if (TxtAccNo.Text != "" && TxtPtype.Text != "")
                    {
                        DataTable dtmodal = new DataTable();
                        string    sql1    = "EXEC A_VOUCHINFO 'MODAL','" + TxtPtype.Text + "','" + ViewState["LoanBrCode"].ToString() + "','" + conn.ConvertDate(Session["ENTRYDATE"].ToString()) + "','" + TxtAccNo.Text + "'";
                        dtmodal = conn.GetDatatable(sql1);
                        if (dtmodal.Rows.Count > 0)
                        {
                            resultout = CR.GetInfo(GrdView, ViewState["LoanBrCode"].ToString(), Session["ENTRYDATE"].ToString(), TxtAccNo.Text, TxtPtype.Text);
                            if (resultout > 0)
                            {
                                string Modal_Flag            = "VOUCHERVIEW";
                                System.Text.StringBuilder sb = new System.Text.StringBuilder();

                                sb.Append(@"<script type='text/javascript'>");
                                sb.Append("$('#" + Modal_Flag + "').modal('show');");
                                sb.Append(@"</script>");

                                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddShowModalScript", sb.ToString(), false);
                            }
                        }
                    }
                }
            }
            else
            {
                lblMessage.Text = "Enter Valid Account Number...!!";
                ModalPopup.Show(this.Page);
                TxtAccNo.Text    = "";
                TxtCustName.Text = "";
                txtCustNo.Text   = "";
                TxtBalance.Text  = "";
                TxtTotalBal.Text = "";
                TxtAccNo.Focus();
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
예제 #5
0
    protected void TxtPtype_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string AC1;

            AC1 = MV.Getaccno(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString());

            if (AC1 != null)
            {
                string[] AC = AC1.Split('_');;
                ViewState["GlCode"]    = AC[0].ToString();
                TxtPname.Text          = AC[1].ToString();
                AutoAccname.ContextKey = ViewState["LoanBrCode"].ToString() + "_" + TxtPtype.Text + "_" + ViewState["GlCode"].ToString();

                string YN = CC.GetIntACCYN(ViewState["LoanBrCode"].ToString(), TxtPtype.Text);
                if (Convert.ToInt32(ViewState["GlCode"].ToString() == "" ? "0" : ViewState["GlCode"].ToString()) >= 100 && YN != "Y") //--abhishek as per GL LEVEL Requirment
                {
                    TxtAccNo.Text    = "";
                    TxtCustName.Text = "";
                    txtCustNo.Text   = "";
                    TxtBalance.Text  = "";
                    TxtTotalBal.Text = "";

                    TxtAccNo.Text    = TxtPtype.Text.ToString();
                    TxtCustName.Text = TxtPname.Text.ToString();
                    txtCustNo.Text   = "0";

                    string[] DTE = Session["EntryDate"].ToString().Split('/');
                    TxtBalance.Text  = OC.GetOpenClose("CLOSING", DTE[2].ToString(), DTE[1].ToString(), TxtPtype.Text.Trim().ToString(), "0", Session["BRCD"].ToString(), Session["EntryDate"].ToString(), ViewState["GlCode"].ToString()).ToString();
                    TxtTotalBal.Text = OC.GetOpenClose("MAIN_CLOSING", DTE[2].ToString(), DTE[1].ToString(), TxtPtype.Text.Trim().ToString(), "0", Session["BRCD"].ToString(), Session["EntryDate"].ToString(), ViewState["GlCode"].ToString()).ToString();

                    //TxtBalance.Text = MV.GetOpenClose(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString(), "0", Session["EntryDate"].ToString(), "ClBal").ToString();
                    //TxtTotalBal.Text = MV.GetOpenClose(ViewState["LoanBrCode"].ToString(), TxtPtype.Text.Trim().ToString(), "0", Session["EntryDate"].ToString(), "MainBal").ToString();

                    TxtNarration.Focus();
                }
                else
                {
                    TxtAccNo.Text    = "";
                    TxtCustName.Text = "";
                    TxtBalance.Text  = "";
                    TxtTotalBal.Text = "";
                    hdfGlCode.Value  = Convert.ToInt32(ViewState["GlCode"].ToString() == "" ? "0" : ViewState["GlCode"].ToString()).ToString();

                    TxtAccNo.Focus();
                }
            }
            else
            {
                lblMessage.Text = "Enter Valid Product code...!!";
                ModalPopup.Show(this.Page);
                ClearText();
                TxtPtype.Focus();
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }