protected void gvdetails_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        Cheque_CashDetails cheDelete = new Cheque_CashDetails();

        cheDelete.CQ_ID         = Convert.ToInt32(((Label)gvdetails.Rows[e.RowIndex].FindControl("lblid2")).Text);
        cheDelete.EmpID         = txtEMcode.Text = ((Label)gvdetails.Rows[e.RowIndex].FindControl("lblempcode")).Text;
        cheDelete.ChequeNo      = ((Label)gvdetails.Rows[e.RowIndex].FindControl("lblchequeno")).Text;
        cheDelete.Deposite_Type = ((Label)gvdetails.Rows[e.RowIndex].FindControl("lblDepositeType")).Text;
        cheDelete.ChequeDate    = Convert.ToString(((Label)gvdetails.Rows[e.RowIndex].FindControl("lblcheque")).Text);
        cheDelete.ReciptNo      = Convert.ToInt32(((Label)gvdetails.Rows[e.RowIndex].FindControl("lblreceipt")).Text);
        cheDelete.CustId        = ((Label)gvdetails.Rows[e.RowIndex].FindControl("lblcustomer")).Text;
        cheDelete.Amount        = Convert.ToDecimal(((Label)gvdetails.Rows[e.RowIndex].FindControl("lblamount")).Text);
        cheDelete.Payee_Bank    = ((Label)gvdetails.Rows[e.RowIndex].FindControl("lblbank")).Text;
        cheDelete.Description   = ((Label)gvdetails.Rows[e.RowIndex].FindControl("lblremark")).Text;
        cheDelete.CreatedBy     = ((Label)gvdetails.Rows[e.RowIndex].FindControl("lblCreated")).Text;

        //cheDelete. = ((Label)gvdetails.Rows[e.RowIndex].FindControl("lblBankId")).Text;
        // lblCustName.Text = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblcustname")).Text;
        // lblshow.Text = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblempname")).Text;
        cheDelete.IsDelete = Convert.ToBoolean(true);

        cheDelete.Update();
        message("Record Deleted successfully");
        BindDataGet();
    }
    public void bindData()
    {
        string Fromdate1 = txtdate.Text.Split('/')[1].ToString() + "/" + txtdate.Text.Split('/')[0].ToString() + "/" + txtdate.Text.Split('/')[2].ToString();
        string Todate1   = txttodate.Text.Split('/')[1].ToString() + "/" + txttodate.Text.Split('/')[0].ToString() + "/" + txttodate.Text.Split('/')[2].ToString();

        //string Fromdate1 = txtdate.Text.Split('/')[1].ToString() + "/" + txtdate.Text.Split('/')[0].ToString() + "/" + txtdate.Text.Split('/')[2].ToString();
        DateTime Fromdate = Convert.ToDateTime(Fromdate1);

        // string Todate1 = txttodate.Text.Split('/')[1].ToString() + "/" + txttodate.Text.Split('/')[0].ToString() + "/" + txttodate.Text.Split('/')[2].ToString();
        DateTime  Todate = Convert.ToDateTime(Todate1);
        DataTable dt     = new DataTable();

        dt = Cheque_CashDetails.Get_ChequeChashDoCancel(Fromdate, Todate).Tables[0];

        lblmessage.Text = "";
        if (dt.Rows.Count != 0)
        {
            GrdViewChequedate.DataSource = dt;
            GrdViewChequedate.DataBind();
            // pnlchequedate.Visible = true;
            GrdViewChequedate.Visible = true;
        }
        else
        {
            message("No such ChequeDate");
            GrdViewChequedate.Visible = false;
            txtdate.Focus();
        }
    }
Exemple #3
0
    public void BindDataGet()
    {
        string ECode = txtcheque.Text.ToString().Split(':')[0].Trim();

        From = txtFromDate.Text.Split('/')[1] + "/" + txtFromDate.Text.Split('/')[0] + "/" + txtFromDate.Text.Split('/')[2];
        To   = txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0] + "/" + txttoDate.Text.Split('/')[2];
        string FromDate = From;
        string ToDate   = To;

        DataTable dss = new DataTable();

        dss = Cheque_CashDetails.get_ChequeCashDeposit(ECode, FromDate, ToDate).Tables[0];
        if (dss.Rows.Count != 0)
        {
            gvdetails.DataSource = dss;
            gvdetails.DataBind();
            getcheque.Visible = true;

            gvdetails.Visible = true;
        }
        else
        {
            MessageBox("No Record Found");
            gvdetails.DataSource = null;
            gvdetails.Visible    = false;
            lblshow.Text         = "No Data Found";
            txtEMcode.Focus();
            txtEMcode.Text   = "";
            txtFromDate.Text = "";
            txttoDate.Text   = "";
            lblshow.Text     = "";
        }
    }
Exemple #4
0
    public void bingcustdata()
    {
        From = txtFromDate1.Text.Split('/')[1] + "/" + txtFromDate1.Text.Split('/')[0] + "/" + txtFromDate1.Text.Split('/')[2];
        To   = txtToDate2.Text.Split('/')[1] + "/" + txtToDate2.Text.Split('/')[0] + "/" + txtToDate2.Text.Split('/')[2];
        string    FromDate = From;
        string    ToDate   = To;
        string    CustCode = txtcustomerid.Text.ToString().Split(':')[0].Trim();
        DataTable dt2      = new DataTable();

        dt2 = Cheque_CashDetails.get_depositDetails(CustCode, FromDate, ToDate).Tables[0];
        if (dt2.Rows.Count != 0)
        {
            gvDeposit.DataSource = dt2;
            gvDeposit.DataBind();
            pnlchequedate.Visible  = false;
            pnlReturnCheck.Visible = false;
            pnldeposit.Visible     = true;
            gvDeposit.Visible      = true;
        }
        else
        {
            message("No such Client Records");
            // lblCustName.Text = "No such Client Records";
            txtcustomerid.Focus();
            txtcustomerid.Text = "";
            txtFromDate1.Text  = "";
            txtToDate2.Text    = "";
            lblCustName.Text   = "";
            gvDeposit.Visible  = false;
        }
    }
Exemple #5
0
    public void bindData()
    {
        string Fromdate = txtdate.Text.Split('/')[1].ToString() + "/" + txtdate.Text.Split('/')[0].ToString() + "/" + txtdate.Text.Split('/')[2].ToString();
        string Todate   = txttodate.Text.Split('/')[1].ToString() + "/" + txttodate.Text.Split('/')[0].ToString() + "/" + txttodate.Text.Split('/')[2].ToString();
        //string date = txtdate.Text.Split('/')[0].ToString() + "/" + txtdate.Text.Split('/')[1].ToString() + "/" + txtdate.Text.Split('/')[2].ToString();

        //  ChequeDate = Convert.ToString(Fromdate);
        DataTable dt = new DataTable();

        dt = Cheque_CashDetails.Get_ChequeChashReport(Fromdate, Todate).Tables[0];

        lblmessage.Text = "";
        if (dt.Rows.Count != 0)
        {
            GrdViewChequedate.DataSource = dt;
            GrdViewChequedate.DataBind();
            minusAmt                  = Convert.ToDecimal(dt.Rows[0]["Amount"].ToString());
            lblminusamt.Text          = string.Format("{0:0.00}", Convert.ToDecimal(dt.Rows[0]["Amount"].ToString()));
            pnlchequedate.Visible     = true;
            GrdViewChequedate.Visible = true;
        }
        else
        {
            if (check != "save")
            {
                message("No such ChequeDate");
            }
            GrdViewChequedate.Visible = false;


            txtdate.Focus();
        }
    }
    protected void btnget_Click(object sender, EventArgs e)
    {
        string from = txtFromDate.Text.Split('/')[1] + "/" + txtFromDate.Text.Split('/')[0] + "/" + txtFromDate.Text.Split('/')[2];
        string To   = txtToDate.Text.Split('/')[1] + "/" + txtToDate.Text.Split('/')[0] + "/" + txtToDate.Text.Split('/')[2];

        fdate = Convert.ToDateTime(from);
        tdate = Convert.ToDateTime(To);
        DataTable dt = new DataTable();

        dt = Cheque_CashDetails.Get_PDC_Details(fdate, tdate, "").Tables[0];
        ViewState["Data"] = dt;
        BindData(dt);
    }
Exemple #7
0
    public void BindLeadgerDetails()
    {
        DataSet ds2 = new DataSet();

        ds2 = Cheque_CashDetails.UnPaidLedgerDetailForClient(ClientId);
        if (ds2.Tables[0].Rows.Count != 0)
        {
            gvLegder.DataSource = ds2;
            gvLegder.DataBind();
            gvLegder.Visible     = true;
            pnlothertext.Visible = true;
        }
        else
        {
            message("NO Record Found");
            gvLegder.Visible     = false;
            pnlothertext.Visible = false;
        }
    }
    protected void GrdViewChequedate_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        Cheque_CashDetails cq = new Cheque_CashDetails();

        cq.CQ_ID         = Convert.ToInt32(((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lblcqid")).Text);
        cq.EmpID         = ((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lblEmpId")).Text;
        cq.CustId        = ((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lblcustid")).Text;
        cq.Deposite_Type = ((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lbldepositType")).Text;
        cq.CreatedBy     = ((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lblcreatedby")).Text;
        cq.ChequeDate    = ((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lblChequeDate")).Text;
        cq.Payee_Bank    = ((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lblPayee_Bank")).Text;
        cq.ReciptNo      = Convert.ToInt32(((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lblrec")).Text);
        cq.ChequeNo      = ((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lblChequeNo")).Text;
        cq.Amount        = Convert.ToDecimal(((Label)GrdViewChequedate.Rows[e.RowIndex].FindControl("lblAmount")).Text);
        cq.IsCancel      = Convert.ToBoolean(true);
        cq.CancelDate    = System.DateTime.Now;
        cq.Save();
        message("Record Deleted successfully");
        bindData();
    }
Exemple #9
0
    protected void gvdetails_RowEditing(object sender, GridViewEditEventArgs e)
    {
        pnlCust.Visible   = true;
        getcheque.Visible = false;
        // btn_Save.Visible = true;
        Cheque_CashDetails chke = new Cheque_CashDetails();

        try
        {
            bool isEditable = Convert.ToBoolean(((Label)gvdetails.Rows[e.NewEditIndex].FindControl("isEditable")).Text);
            if (isEditable == false)
            {
                btn_Save.Visible = false;
                MessageBox("This Record is locked for Edit");
                lblIsEditable.Visible = true;
            }
            else
            {
                btn_Save.Visible = true;
            }

            lblID.Text           = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblid2")).Text;
            txtEMcode.Text       = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblempcode")).Text;
            txtCheck.Text        = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblchequeno")).Text;
            Cheque.SelectedValue = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblDepositeType")).Text;
            txtChequeDate.Text   = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblcheque")).Text;
            txtReciptNo.Text     = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblreceipt")).Text;
            txtcustomerid.Text   = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblcustomer")).Text;
            txtAmount.Text       = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblamount")).Text;
            txtBankName.Text     = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblbank")).Text;
            txtRemark.Text       = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblremark")).Text;
            lblCustName.Text     = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblcustname")).Text;
            lblshow.Text         = ((Label)gvdetails.Rows[e.NewEditIndex].FindControl("lblempname")).Text;
        }
        catch (Exception ex)
        {
        }
    }
Exemple #10
0
    protected void btn_Save_Click(object sender, EventArgs e)

    {
        if (Session["UserName"] != null)
        {
            Cheque_CashDetails che = new Cheque_CashDetails();
            if (lblID.Text == "")
            {
                lblID.Text = "0";
            }
            che.CQ_ID = Convert.ToInt32(lblID.Text);

            che.EmpID    = txtEMcode.Text.Trim();
            che.ChequeNo = txtCheck.Text.Trim();
            //string txtChequeDate= Convert.ToDateTime(txtChequeDate.Text.Split('/')[1] + "/" + txtChequeDate.Text.Split('/')[0] + "/" + txtChequeDate.Text.Split('/')[2]);
            if (txtChequeDate.Text == "")
            {
                ChequeDate1 = "";
            }
            else
            {
                ChequeDate1 = txtChequeDate.Text.Split('/')[1] + "/" + txtChequeDate.Text.Split('/')[0] + "/" + txtChequeDate.Text.Split('/')[2];
            }
            che.ChequeDate = ChequeDate1;


            che.CustId     = txtcustomerid.Text.Trim();
            che.ReciptNo   = Convert.ToInt32(txtReciptNo.Text.Trim());
            che.Payee_Bank = txtBankName.Text.Trim();
            //che.Deposited_By = txtDeposit.Text.Trim();

            che.Amount        = Convert.ToDecimal(txtAmount.Text.Trim());
            che.CreatedBy     = Session["UserName"].ToString();
            che.Description   = txtRemark.Text.Trim();
            che.FinancialYear = Convert.ToInt32(strFY);
            if (Cheque.Items[0].Selected)
            {
                pnlCust.Visible = true;

                che.Deposite_Type = Cheque.SelectedValue;
            }
            else
            {
                pnlCust.Visible = true;

                che.Deposite_Type = Cheque.SelectedValue;
            }
            if (lblID.Text == "0")
            {
                che.Save(1, out IDNo);
            }
            else
            {
                che.Update();
            }

            lblId3.Text = Convert.ToString("CQ ID :" + (IDNo));
            message("Record Saved Successfully");
            if (lblID.Text == "0")
            {
                lblId3.Visible = true;
            }
            else
            {
                lblId3.Visible = false;
            }
            pnlCust.Visible    = true;
            lblempname.Text    = "";
            txtEMcode.Text     = "";
            txtCheck.Text      = "";
            txtChequeDate.Text = "";
            txtcustomerid.Text = "";
            txtReciptNo.Text   = "";
            //txtDeposit.Text = "";
            txtAmount.Text   = "";
            txtBankName.Text = "";
            lblshow.Text     = "";
            lblCustName.Text = "";
            //lblbank.Text = "";
            txtRemark.Text = "";
        }
        else
        {
            Response.Redirect("LoginUserDetails.aspx");
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     dcEventsCalendar.DataSource = Cheque_CashDetails.get_Count_Calender1();
     dcEventsCalendar.DataBind();
 }
Exemple #12
0
    protected void lblupdate_Click(object sender, EventArgs e)
    {
        try
        {
            Button  lnkUpdate      = (Button)sender;
            TextBox txtRemark      = (TextBox)lnkUpdate.Parent.FindControl("txtRemark");
            TextBox txtDepositDate = (TextBox)lnkUpdate.Parent.FindControl("txtDepositDate");
            TextBox txtBankName    = (TextBox)lnkUpdate.Parent.FindControl("txtBankName");

            foreach (GridViewRow gv in GrdViewChequedate.Rows)
            {
                if (Convert.ToInt32(lblCid.Text.ToString()) == Convert.ToInt32(((Label)gv.FindControl("lblcqid")).Text))
                {
                    if (txtDepositDate.Text != "" && txtBankName.Text != "")
                    {
                        //ddate = Convert.ToDateTime(txtDepositDate.Text.ToString());
                        DateTime ddate;
                        string   date = txtDepositDate.Text.Split('/')[1] + "/" + txtDepositDate.Text.Split('/')[0] + "/" + txtDepositDate.Text.Split('/')[2];
                        ddate = Convert.ToDateTime(date);
                        DateTime Cdate;

                        Cdate = Convert.ToDateTime((((Label)gv.FindControl("lblChequeDate")).Text).ToString());
                        if (ddate < Cdate)
                        {
                            MessageBox("Cheque date should be greater than deposited date ");
                        }
                        else
                        {
                            Cheque_CashDetails chk = new Cheque_CashDetails();
                            chk.CQ_ID = Convert.ToInt32(((Label)gv.FindControl("lblcqid")).Text);
                            //chk.EmpID = (((Label)gv.FindControl("lblEmpId")).Text);
                            //chk.CustId = (((Label)gv.FindControl("lblcustid")).Text);
                            chk.EmpID    = (((Label)gv.FindControl("lblEmpCode1")).Text);
                            chk.CustId   = (((Label)gv.FindControl("lblCustCode1")).Text);
                            chk.ReciptNo = Convert.ToInt32(((Label)gv.FindControl("lblrec")).Text);
                            //  lblReceiptNo123.Text =
                            chk.Deposite_Type = (((Label)gv.FindControl("lbldepositType")).Text);
                            chk.ChequeDate    = (((Label)gv.FindControl("lblChequeDate")).Text);
                            chk.ChequeNo      = (((Label)gv.FindControl("lblChequeNo")).Text);
                            chk.Amount        = Convert.ToDecimal(((Label)gv.FindControl("lblAmount")).Text);
                            chk.CreatedBy     = ((Label)gv.FindControl("lblcreatedby")).Text;
                            //chk.BankCode = ((Label)lnkUpdate.Parent.FindControl("lblBankCode")).Text;
                            chk.Payee_Bank = ((Label)gv.FindControl("lblPayee_Bank")).Text;
                            ///////////ledger entry/////////
                            Ledgerdetails ldpay = new Ledgerdetails();
                            ldpay.Amount  = Convert.ToDecimal(((Label)gv.FindControl("lblAmount")).Text);
                            ldpay.CustId  = ((Label)gv.FindControl("lblcustid")).Text;
                            ldpay.OtherId = ((Label)gv.FindControl("lblcqid")).Text;
                            ldpay.FY      = Convert.ToInt32(strFY);
                            //////////end/////////////
                            foreach (GridViewRow gv1 in gvLegder.Rows)
                            {
                                if ((((CheckBox)gv1.FindControl("chkclose")).Checked) == true)
                                {
                                    //    ///////////Payment pending ///////////
                                    //  ReceivedAmt = ReceivedAmt +  Convert.ToDecimal(((TextBox)gv1.FindControl("txtreceivable")).Text);
                                    //Convert.ToDecimal(ReceivedAmt);

                                    //}

                                    // ReceivedAmt = Convert.ToDecimal(((TextBox)gv1.FindControl("txtreceivable")).Text);

                                    /////////////Reused code////////////
                                    // Ledgerdetails ldpay = new Ledgerdetails();
                                    //ldpay.Amount = Convert.ToDecimal(((Label)gv.FindControl("lblAmount")).Text);
                                    // ldpay.CustId = ((Label)gv.FindControl("lblcustid")).Text;
                                    // ldpay.OtherId = ((Label)gv.FindControl("lblcqid")).Text;
                                    // ldpay.update();
                                    ///////////end////////////////
                                    Receivable = Convert.ToDecimal(((TextBox)gv1.FindControl("txtreceivable")).Text);


                                    LedgerPaymentdetails ld = new LedgerPaymentdetails();

                                    ld.Autoid        = Convert.ToInt32("0");
                                    ld.CQ_ID         = Convert.ToInt32(lblCid.Text.Trim());
                                    ld.InvoiceNo     = Convert.ToDecimal(((Label)gv1.FindControl("lblotherId")).Text);
                                    ld.debitAmount   = Convert.ToDecimal(((Label)gv1.FindControl("lblDebitAmount")).Text);
                                    ld.ReceiptAmount = Convert.ToDecimal(((TextBox)gv1.FindControl("txtreceivable")).Text);
                                    ld.ReceiptNo     = Convert.ToInt32(((Label)gv.FindControl("lblrec")).Text);

                                    if (Receivable > 0)
                                    {
                                        ld.save();
                                    }
                                }

                                //  message("Record Saved Successfully");
                                // Response.Redirect(Request.RawUrl.Replace("/Website/", "").ToString());
                            }
                            //chk.BankID = Convert.ToInt32(((Label)lnkUpdate.Parent.FindControl("lblBankID")).Text);
                            if (txtDepositDate.Text == "")
                            {
                                ChequeDate2 = "";
                            }
                            else
                            {
                                ChequeDate2     = txtDepositDate.Text.Split('/')[0] + "/" + txtDepositDate.Text.Split('/')[1] + "/" + txtDepositDate.Text.Split('/')[2];
                                chk.DepositDate = ChequeDate2;
                                if (((Label)gv.FindControl("lblChequeNo")).Text == "")
                                {
                                    string    BankCode = txtBankName.Text.ToString().Split(':')[0].Trim();
                                    DataTable dt       = new DataTable();
                                    dt = DCMaster.Get_Name(BankCode, "Bank").Tables[0];
                                    if (dt.Rows.Count != 0)
                                    {
                                        txtBankName.Text = BankCode;
                                        //lblbank.Text = Convert.ToString(dt.Rows[0]["BankName"]);
                                        chk.BankCode      = txtBankName.Text.ToString().Split(':')[0].Trim();
                                        chk.Description   = txtRemark.Text.Trim().ToString();
                                        chk.ISactive      = true;
                                        chk.FinancialYear = Convert.ToInt32(strFY);
                                        chk.Save(1);
                                        ldpay.update(1);

                                        // ld.save();
                                        message("Record Saved Successfully");
                                        bindData();
                                        pnlothertext.Visible = true;
                                        check = "save";
                                        Response.Redirect(Request.RawUrl.Replace("/Website/", "").ToString());
                                    }
                                    else
                                    {
                                        chk.BankCode = txtBankName.Text.ToString().Split(':')[0].Trim();

                                        chk.Description   = txtRemark.Text.Trim().ToString();
                                        chk.ISactive      = true;
                                        chk.FinancialYear = Convert.ToInt32(strFY);
                                        chk.Save(1);
                                        ldpay.update(1);

                                        // ld.save();
                                        message("Record Saved Successfully");
                                        bindData();
                                        check = "save";
                                        pnlothertext.Visible = true;
                                        Response.Redirect(Request.RawUrl.Replace("/Website/", "").ToString());
                                    }
                                }
                                else
                                {
                                    string BankCode = txtBankName.Text.ToString().Split(':')[0].Trim();

                                    DataTable dt = new DataTable();
                                    dt = DCMaster.Get_Name(BankCode, "Bank").Tables[0];
                                    if (dt.Rows.Count != 0)
                                    {
                                        txtBankName.Text = BankCode;
                                        //lblbank.Text = Convert.ToString(dt.Rows[0]["BankName"]);
                                        chk.BankCode      = txtBankName.Text.ToString().Split(':')[0].Trim();
                                        chk.Description   = txtRemark.Text.Trim().ToString();
                                        chk.ISactive      = true;
                                        chk.FinancialYear = Convert.ToInt32(strFY);
                                        chk.Save(1);
                                        ldpay.update(1);


                                        //  ld.save();
                                        message("Record Saved Successfully");
                                        bindData();
                                        check = "save";
                                        pnlothertext.Visible = true;
                                        Response.Redirect(Request.RawUrl.Replace("/Website/", "").ToString());
                                    }


                                    else
                                    {
                                        message("No such Bank code");
                                        txtBankName.Focus();
                                        txtBankName.Text = "";
                                    }
                                }
                            }


                            // }
                        }
                    }

                    else
                    {
                        message("Kindly enter BankName,Date details");
                    }
                }
            }
        }


        catch
        {
        }
    }
Exemple #13
0
    protected void buttonsave_Click(object sender, EventArgs e)
    {
        try
        {
            ChequeBounceDetails cb = new ChequeBounceDetails();
            cb.AutoId    = Convert.ToInt32("0");
            cb.ReceiptNo = Convert.ToInt32(lblreceiptnoret.Text);
            //Convert.ToInt32(lnkBounce.Text);
            cb.ChequeNo         = lblCheckNoRetun.Text;
            cb.ChequeReturnDate = txtReturnDate.Text.Split('/')[1].ToString() + "/" + txtReturnDate.Text.Split('/')[0].ToString() + "/" + txtReturnDate.Text.Split('/')[2].ToString();
            cb.ReturnAmount     = Convert.ToDecimal(txtReturnAmount.Text.Trim());
            cb.ReturnRemark     = txttRetRemark.Text.Trim();
            DateTime Chequedate = Convert.ToDateTime(txtReturnDate.Text.Split('/')[1].ToString() + "/" + txtReturnDate.Text.Split('/')[0].ToString() + "/" + txtReturnDate.Text.Split('/')[2].ToString());
            foreach (GridViewRow gvBouncedetails2 in gvBouncedetails.Rows)
            {
                cb.Amount = Convert.ToDecimal(((Label)gvBouncedetails2.FindControl("lbl_BounceAmount2")).Text);
                cb.Cq_id  = Convert.ToInt32(((Label)gvBouncedetails2.FindControl("lblcq_id2")).Text);
                cb.FYfrom = Convert.ToInt32(((Label)gvBouncedetails2.FindControl("lblFinYearFrom")).Text);
                cb.FYto   = Convert.ToInt32(((Label)gvBouncedetails2.FindControl("lblFinYearTo")).Text);

                DateTime           gvChequeDate = Convert.ToDateTime(((Label)gvBouncedetails2.FindControl("lblCheque_Date2")).Text);
                Cheque_CashDetails isacive      = new Cheque_CashDetails();
                isacive.CQ_ID = Convert.ToInt32(((Label)gvBouncedetails2.FindControl("lblcq_id2")).Text);
                //isacive.EmpID = ((Label)gvBouncedetails2.FindControl("lbl_emp2")).Text;
                //isacive.CustId = ((Label)gvBouncedetails2.FindControl("lblcust_id2")).Text;
                //isacive.Deposite_Type = ((Label)gvBouncedetails2.FindControl("lbldeposit_Type2")).Text;
                //isacive.ChequeDate = ((Label)gvBouncedetails2.FindControl("lblCheque_Date2")).Text;
                //isacive.ChequeNo = ((Label)gvBouncedetails2.FindControl("lblche_no2")).Text;
                //isacive.ReciptNo = Convert.ToInt32(((Label)gvBouncedetails2.FindControl("lblrec_no2")).Text);
                //isacive.Amount = Convert.ToDecimal(((Label)gvBouncedetails2.FindControl("lbl_BounceAmount2")).Text);
                //isacive.BankName = ((Label)gvBouncedetails2.FindControl("lbl_deposit2")).Text;
                //isacive.DepositDate = ((Label)gvBouncedetails2.FindControl("lbl_depositDate2")).Text;
                //isacive.Description = ((Label)gvBouncedetails2.FindControl("lbl_Remark2")).Text;
                isacive.ISactive = false;
                if (Chequedate <= gvChequeDate)
                {
                    message("ChequeDate should be less than Date");
                }
                else
                {
                    cb.Save();
                    isacive.Updatebounce();
                    message("Record Saved Successfully");
                    bingcustdata();
                    txtRemark.Text       = "";
                    txtReturnDate.Text   = "";
                    txtDepositDate.Text  = "";
                    lblreceiptnoret.Text = "";
                    lblCheckNoRetun.Text = "";
                    txttRetRemark.Text   = "";
                    txtReturnAmount.Text = "";
                }
            }

            txtRemark.Text       = "";
            txtReturnDate.Text   = "";
            txtDepositDate.Text  = "";
            lblreceiptnoret.Text = "";
            lblCheckNoRetun.Text = "";
            txttRetRemark.Text   = "";
            txtReturnAmount.Text = "";
            bingcustdata();
            pnlReturnCheck.Visible    = false;
            pnlchequedate.Visible     = false;
            pnlcust.Visible           = false;
            pnlothertext.Visible      = false;
            pnldeposit.Visible        = true;
            gvDeposit.Visible         = true;
            GrdViewChequedate.Visible = false;
            buttonsave.Visible        = false;
        }
        catch
        { }
    }