protected void ddlPMTMode_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         DdlCRDR.Focus();
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
     }
 }
Example #2
0
    protected void lnkSelect_Click(object sender, EventArgs e)
    {
        try
        {
            LinkButton objlink = (LinkButton)sender;
            string[]   ID      = objlink.CommandArgument.Split('_');
            ViewState["ID"] = objlink.CommandArgument.ToString();

            DT = new DataTable();
            DT = MV.GetSetAmount(ID[0].ToString(), ID[1].ToString(), ID[2].ToString(), Session["BRCD"].ToString());
            if (DT.Rows.Count > 0)
            {
                //EntryDate = ID[2].ToString();
                //VoucherNo = ID[1].ToString();
                ResBrCode     = DT.Rows[0]["BRCD"].ToString();
                TxtCRBAL.Text = Convert.ToDouble(DT.Rows[0]["Credit"].ToString()).ToString();
                TxtDRBAL.Text = Convert.ToDouble(DT.Rows[0]["Debit"].ToString()).ToString();

                DT1 = new DataTable();
                DT1 = MV.GetADMSubGl(DT.Rows[0]["BRCD"].ToString());

                if (Convert.ToDouble(TxtDRBAL.Text) > 0)
                {
                    resultout = MV.InsertIntoTable(Session["BRCD"].ToString(), Session["BRCD"].ToString(), Session["BRCD"].ToString(), "0", "0", DT1.Rows[0]["ADMGlCode"].ToString(), DT1.Rows[0]["ADMSubGlCode"].ToString(), "0", "", TxtDRBAL.Text.Trim().ToString(), "1", "7", "TR", "", "", "0", "1900-01-01", Session["EntryDate"].ToString(), Session["MID"].ToString());
                }
                else if (Convert.ToDouble(TxtCRBAL.Text) > 0)
                {
                    resultout = MV.InsertIntoTable(Session["BRCD"].ToString(), Session["BRCD"].ToString(), Session["BRCD"].ToString(), "0", "0", DT1.Rows[0]["ADMGlCode"].ToString(), DT1.Rows[0]["ADMSubGlCode"].ToString(), "0", "", TxtCRBAL.Text.Trim().ToString(), "2", "7", "TR", "", "", "0", "1900-01-01", Session["EntryDate"].ToString(), Session["MID"].ToString());
                }

                if (resultout > 0)
                {
                    //ddlPMTMode.Enabled = false;
                    DivBranch.Visible         = false;
                    DdlCRDR.SelectedValue     = "0";
                    ddlActivity.SelectedValue = "0";
                    Getinfo();
                    BindTransGrid();
                    ClearText();
                    DdlCRDR.Focus();
                    lblMessage.Text = "Successfully Added...!!";
                    ModalPopup.Show(this.Page);
                }
                return;
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
Example #3
0
 protected void ddlPMTMode_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (ddlPMTMode.SelectedValue == "3")
         {
             DivCash.Visible = true;
             DdlCRDR.Focus();
         }
         else if (ddlPMTMode.SelectedValue == "7")
         {
             DivCash.Visible = true;
             DdlCRDR.Focus();
         }
     }
     catch (Exception Ex)
     {
         ExceptionLogging.SendErrorToText(Ex);
     }
 }
Example #4
0
    protected void Submit_Click(object sender, EventArgs e)
    {
        try
        {
            string AC, AN;
            AN = AC = "";

            if (DdlCRDR.SelectedValue == "1")
            {
                if (txtLoanBrCode.Text.Trim().ToString() == "")
                {
                    lblMessage.Text = "Select branch first...!!";
                    ModalPopup.Show(this.Page);
                    return;
                }
            }

            if (DdlCRDR.SelectedValue == "0")
            {
                lblMessage.Text = "Select transaction type...!!";
                ModalPopup.Show(this.Page);
                return;
            }

            if (ddlPMTMode.SelectedValue == "0")
            {
                lblMessage.Text = "Select payment mode first...!!!";
                ModalPopup.Show(this.Page);
                return;
            }

            if (ddlPMTMode.SelectedValue == "7")
            {
                if (TxtPtype.Text.Trim().ToString() == "")
                {
                    lblMessage.Text = "Enter product type first...!!";
                    ModalPopup.Show(this.Page);
                    return;
                }

                if (TxtAccNo.Text.Trim().ToString() == "")
                {
                    lblMessage.Text = "Enter account number first...!!";
                    ModalPopup.Show(this.Page);
                    return;
                }
            }

            if (TxtNarration.Text.Trim().ToString() == "")
            {
                lblMessage.Text = "Enter narration first...!!";
                ModalPopup.Show(this.Page);
                return;
            }

            if (Convert.ToDouble(TxtAmount.Text.Trim().ToString() == "" ? "0" : TxtAmount.Text.Trim().ToString()) <= 0.00)
            {
                lblMessage.Text = "Enter proper amount First...!!";
                ModalPopup.Show(this.Page);
                return;
            }

            //If Account Number is blank Then Set Acc No and Cust No to Zero
            string YN = CC.GetIntACCYN(ViewState["LoanBrCode"].ToString(), TxtPtype.Text);
            if (Convert.ToInt32(ViewState["GlCode"].ToString() == "" ? "0" : ViewState["GlCode"].ToString()) >= 100 && YN != "Y")
            {
                AC = "0";
                AN = TxtPname.Text.ToString();
            }
            else
            {
                AC = TxtAccNo.Text.Trim().ToString();
                AN = TxtCustName.Text.ToString();
            }

            //Check Amount is grater than zero or not
            if (Convert.ToDouble(TxtAmount.Text.Trim().ToString() == "" ? "0" : TxtAmount.Text.Trim().ToString()) > 0.00)
            {
                if (txtLoanBrCode.Text.Trim().ToString() == "")
                {
                    ResBrCode = Session["BRCD"].ToString();
                }
                else
                {
                    ResBrCode = txtLoanBrCode.Text.Trim().ToString();
                }

                //Insert Data into Temporary Table (Avs_TempMultiTransfer) in Database here
                if (ddlPMTMode.SelectedValue == "0")
                {
                    ddlPMTMode.Focus();

                    lblMessage.Text = "Select payment mode first...!!";
                    ModalPopup.Show(this.Page);
                    return;
                }
                else if (ddlPMTMode.SelectedValue == "3")
                {
                    resultout = MV.InsertIntoTable(Session["BRCD"].ToString(), Session["BRCD"].ToString(), Session["BRCD"].ToString(), ResBrCode.ToString(), txtCustNo.Text.Trim().ToString() == "" ? "0" : txtCustNo.Text.Trim().ToString(), "99", "99", "0", "", TxtAmount.Text.Trim().ToString(), DdlCRDR.SelectedValue == "1" ? "1" : "2", "3", "CR", "99/0", TxtNarration.Text.ToString(), "0", "1900-01-01", Session["EntryDate"].ToString(), Session["MID"].ToString());
                }
                else if (ddlPMTMode.SelectedValue == "7")
                {
                    resultout = MV.InsertIntoTable(Session["BRCD"].ToString(), Session["BRCD"].ToString(), Session["BRCD"].ToString(), ResBrCode.ToString(), txtCustNo.Text.Trim().ToString() == "" ? "0" : txtCustNo.Text.Trim().ToString(), ViewState["GlCode"].ToString(), TxtPtype.Text.Trim().ToString(), AC.Trim().ToString(), AN.ToString(), TxtAmount.Text.Trim().ToString(), DdlCRDR.SelectedValue == "1" ? "1" : "2", "7", "TR", TxtPtype.Text.Trim().ToString() + "/" + AC.Trim().ToString() + " - " + AN.ToString() + "", TxtNarration.Text.ToString(), "0", "1900-01-01", Session["EntryDate"].ToString(), Session["MID"].ToString());
                }

                if (resultout > 0)
                {
                    ddlPMTMode.Enabled = false;
                    lblMessage.Text    = "Successfully Added...!!";
                    ModalPopup.Show(this.Page);
                }
            }
            else
            {
                lblMessage.Text = "Enter Amount First...!!";
                ModalPopup.Show(this.Page);
                return;
            }

            if (resultout > 0)
            {
                DivBranch.Visible         = false;
                DdlCRDR.SelectedValue     = "0";
                ddlActivity.SelectedValue = "0";
                Getinfo();
                BindTransGrid();
                ClearText();
                DdlCRDR.Focus();
                return;
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }