Beispiel #1
0
        protected void RadToolBarCreditMemo_OnButtonClick(object sender, RadToolBarEventArgs e)
        {
            if (RadGridCreditMemo.SelectedValue != null)
            {
                switch (e.Item.Text)
                {
                case "Disbursement":
                    var cCreditMemoPayout    = new CCreditMemoPayout();
                    var creditMemoPayoutList = cCreditMemoPayout.GetCreditMemoPayoutList(Convert.ToInt32(RadGridCreditMemo.SelectedValue));
                    var currentDate          = DateTime.Now;
                    foreach (var creditMemoPayout in creditMemoPayoutList)
                    {
                        if (creditMemoPayout.Disbursement == false && creditMemoPayout.ApprovalStatus == (int)CConstValue.ApprovalStatus.Approved)
                        {
                            creditMemoPayout.Disbursement     = true;
                            creditMemoPayout.DisbursementDate = currentDate;
                            creditMemoPayout.UpdatedId        = CurrentUserId;
                            creditMemoPayout.UpdatedDate      = currentDate;
                            cCreditMemoPayout.Update(creditMemoPayout);
                        }
                    }
                    RadGridCreditMemo.Rebind();
                    RadGridCreditMemoPayout.Rebind();
                    break;

                case "View Invoice":
                    RunClientScript("ShowInvoiceWindow(" + RadGridCreditMemo.SelectedValues["InvoiceId"] + ");");
                    break;

                case "View Payment":
                    RunClientScript("ShowPaymentHistoryWindow(" + RadGridCreditMemo.SelectedValues["InvoiceId"] + ");");
                    break;

                case "View Deposit":
                    var cPayment = new CPayment();
                    var payment  = cPayment.Get(Convert.ToInt32(RadGridCreditMemo.SelectedValues["PaymentId"]));
                    if (payment != null)
                    {
                        var depositPayment = new CDepositPayment().GetByPaymentId(payment.PaymentId);
                        if (depositPayment != null)
                        {
                            RunClientScript("ShowDepositPaymentWindow(" + depositPayment.DepositId + ");");
                        }
                    }

                    break;

                case "Student Page":
                    Response.Redirect("~/Student?id=" + RadGridCreditMemo.SelectedValues["StudentId"]);
                    break;

                case "Invoice Page":
                    Response.Redirect("~/Invoice?id=" + RadGridCreditMemo.SelectedValues["StudentId"]);
                    break;

                case "Payment Page":
                    Response.Redirect("~/Payment?id=" + RadGridCreditMemo.SelectedValues["StudentId"]);
                    break;

                case "Deposit Page":
                    Response.Redirect("~/Deposit?id=" + RadGridCreditMemo.SelectedValues["StudentId"]);
                    break;

                case "Refund Page":
                    Response.Redirect("~/Refund?id=" + RadGridCreditMemo.SelectedValues["StudentId"]);
                    break;
                }
            }
        }
Beispiel #2
0
 protected void RefreshPayoutHistory(object sender, EventArgs e)
 {
     RadGridCreditMemo.Rebind();
     RadGridCreditMemoPayout.Rebind();
     RadGridCreditMemoPayoutHistory.Rebind();
 }
Beispiel #3
0
 protected void Refresh(object sender, EventArgs e)
 {
     RadGridCreditMemo.Rebind();
     RadGridCreditMemoPayout.Rebind();
     RefreshApprovalList();
 }