protected void btnSave_Click(object sender, EventArgs e)
        {
            FeesPayment fp = new FeesPayment();

            fp.ID           = int.Parse(txtpayID.Text);
            fp.LastModified = dtPayDate.Date;
            fp.CashedBy     = txtCashedBy.Text;
            fp.Cleared      = "Yes";

            if (new FeesPaymentService().UpdateChequePayments(fp, new SessionManager().GetUserId(this.Session)))
            {
                ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.success('Saved Successfully','Message')", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.error('Saving Failed','Message')", true);
            }

            div_payment.Visible = false;
            clearfields();
            loadPayments();
            uPanel.Update();
        }
Exemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!validateInputs())
            {
                uPanel.Update();
                return;
            }

            FeesPayment fp = new FeesPayment();

            fp.Bank         = int.Parse(cmbBank.Value.ToString());
            fp.BatchId      = int.Parse(txtbatchID.Text);
            fp.Bgroup       = txtbgroup.Text;
            fp.Branch       = txtBranch.Text;
            fp.CashedBy     = txtCashedBy.Text;
            fp.ChequeNo     = txtChequeNo.Text;
            fp.Cleared      = txtCleared.Text;
            fp.DateCreated  = dtPayDate.Date;
            fp.LastModified = DateTime.Now;
            fp.PaidBy       = txtPaidinBy.Text;
            fp.PayType      = cmbPayType.Value.ToString();
            fp.Payvalue     = double.Parse(spntAmt.Value.ToString());
            fp.ReceiptNo    = txtReciept.Text;
            fp.StuduserId   = txtstudID.Text;

            if (txtFpid.Text == "0")
            {
                if (new FeesPaymentService().AddFeesPayment(fp, new SessionManager().GetUserId(this.Session)))
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.success('Saved Successfully','Message')", true);
                    clearFields();


                    Session["fromwhere"] = "~/feespayment.aspx";
                    Session["report"]    = new mySmis.reports.rptFeesReceipt(fp.ReceiptNo, new SessionManager().GetUserId(this.Session));

                    Response.Redirect("~/documentviewer.aspx");
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.error('Saving Failed','Message')", true);
                }
            }
            else
            {
                fp.ID = int.Parse(txtFpid.Text);
                if (new FeesPaymentService().UpdateChequePayments(fp, new SessionManager().GetUserId(this.Session)))
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.success('Updated Successfully','Message')", true);
                    clearFields();

                    Session["fromwhere"] = "~/feespayment.aspx";
                    Session["report"]    = new mySmis.reports.rptFeesReceipt(fp.ReceiptNo, new SessionManager().GetUserId(this.Session));

                    Response.Redirect("~/documentviewer.aspx");
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.error('Updating Failed','Message')", true);
                }
            }
            uPanel.Update();
        }