Example #1
0
 protected void RadTabStript1_OnTabClick(object sender, RadTabStripEventArgs e)
 {
     if (e.Tab.Text == "Payout History")
     {
         RadGridCreditMemoPayoutHistory.Rebind();
     }
     else if (e.Tab.Text == "Payout")
     {
         RadGridCreditMemoPayout.Rebind();
     }
 }
Example #2
0
        protected void RadToolBarCreditMemoPayoutHistory_OnButtonClick(object sender, RadToolBarEventArgs e)
        {
            switch (e.Item.Text)
            {
            case "Add Payout":
                if (RadGridCreditMemoPayout.SelectedValue != null)
                {
                    RunClientScript("ShowPayoutHistoryPop('" + RadGridCreditMemoPayout.SelectedValue + "', '0');");
                }
                break;

            case "Payout Reverse":
                if (RadGridCreditMemoPayoutHistory.SelectedValue != null)
                {
                    var creditMemoPayoutHistory = new CCreditMemoPayoutHistory().Get(Convert.ToInt32(RadGridCreditMemoPayoutHistory.SelectedValue));
                    if (creditMemoPayoutHistory.PayoutAmount > 0)
                    {
                        var cNewCreditMemoPayoutHistory = new CCreditMemoPayoutHistory();
                        var newCreditMemoPayoutHistory  = new Erp2016.Lib.CreditMemoPayoutHistory();
                        CGlobal.Copy(creditMemoPayoutHistory, newCreditMemoPayoutHistory);
                        newCreditMemoPayoutHistory.PayoutAmount *= -1;
                        newCreditMemoPayoutHistory.OriginalCreditMemoPayoutHistoryId = creditMemoPayoutHistory.CreditMemoPayoutHistoryId;

                        cNewCreditMemoPayoutHistory.Add(newCreditMemoPayoutHistory);

                        RadGridCreditMemoPayout.Rebind();
                        RadGridCreditMemoPayoutHistory.Rebind();
                    }
                    else
                    {
                        ShowMessage("Negative price can't reverse");
                    }
                }
                break;
            }
        }
Example #3
0
 protected void RefreshPayoutHistory(object sender, EventArgs e)
 {
     RadGridCreditMemo.Rebind();
     RadGridCreditMemoPayout.Rebind();
     RadGridCreditMemoPayoutHistory.Rebind();
 }
Example #4
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;
                }
            }
        }
Example #5
0
 protected void Refresh(object sender, EventArgs e)
 {
     RadGridCreditMemo.Rebind();
     RadGridCreditMemoPayout.Rebind();
     RefreshApprovalList();
 }