Beispiel #1
0
        private void LoadPaymentDetail()
        {
            RadGridPayment.DataSource = PaymentDetail;
            RadGridPayment.DataBind();

            lblTotalPayment.Text = PaymentDetail.Where(pvm => !pvm.Void).Sum(pvm => pvm.Amount).ToString("N");
        }
Beispiel #2
0
        protected void RadToolBarPaymentTop_OnButtonClick(object sender, RadToolBarEventArgs e)
        {
            if (RadGridPayment.SelectedValue != null)
            {
                switch (e.Item.Text)
                {
                case "Student Reciept":
                    RunClientScript("ShowReportPop('" + RadGridPayment.SelectedValue + "', '" + (int)CConstValue.Report.PaymentStudent + "');");
                    break;

                case "Agency Reciept":
                    RunClientScript("ShowReportPop('" + RadGridPayment.SelectedValue + "','" + (int)CConstValue.Report.PaymentAgency + "');");
                    break;

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

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

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

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

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

                case "Change status of Gross Based":
                    var cInvoice = new CInvoice();
                    var invoice  = cInvoice.Get(Convert.ToInt32(RadGridPayment.SelectedValue));
                    if (invoice != null)
                    {
                        invoice.IsGross   = !invoice.IsGross;
                        invoice.UpdatedId = CurrentUserId;
                        if (cInvoice.Update(invoice))
                        {
                            RadGridPayment.Rebind();
                            ShowMessage("Gross Based has been changed.");
                        }
                        else
                        {
                            ShowMessage("Error : Gross Based");
                        }
                    }
                    break;
                }
            }
        }
Beispiel #3
0
        protected void RadToolBarPayment_OnButtonClick(object sender, RadToolBarEventArgs e)
        {
            switch (e.Item.Text)
            {
            case "New Payment":
                if (RadGridPayment.SelectedValue != null)
                {
                    RunClientScript("ShowNewPaymentWindow('" + RadGridPayment.SelectedValue + "');");
                }
                break;

            case "Agency Detail Reciept":
                if (_radGridPaymentHistory.SelectedValue != null)
                {
                    var selectedInvoiceList = new List <int>();
                    foreach (GridDataItem item in _radGridPaymentHistory.SelectedItems)
                    {
                        selectedInvoiceList.Add((int)item.GetDataKeyValue("PaymentId"));
                    }

                    RunClientScript("ShowReportPop('" + String.Join(", ", selectedInvoiceList.ToArray()) + "', '" + (int)CConstValue.Report.DetailPaymentAgency + "' );");
                }
                break;

            case "Student Detail Reciept":
                if (_radGridPaymentHistory.SelectedValue != null)
                {
                    var selectedInvoiceList = new List <int>();
                    foreach (GridDataItem item in _radGridPaymentHistory.SelectedItems)
                    {
                        selectedInvoiceList.Add((int)item.GetDataKeyValue("PaymentId"));
                    }

                    RunClientScript("ShowReportPop('" + String.Join(", ", selectedInvoiceList.ToArray()) + "', '" + (int)CConstValue.Report.DetailPaymentStudent + "' );");
                }

                //if (_radGridPaymentHistory.SelectedValue != null)
                //{
                //    RunClientScript("ShowReportPop('" + _radGridPaymentHistory.SelectedValue + "', '" + (int)CConstValue.Report.DetailPaymentStudent + "');");
                //}
                break;

            case "Payment Reverse":
                if (_radGridPaymentHistory.SelectedValue != null)
                {
                    var payment = new CPayment().Get(Convert.ToInt32(_radGridPaymentHistory.SelectedValue));
                    if (payment.Amount > 0)
                    {
                        var cNewPayment = new CPayment();
                        var newPayment  = new Erp2016.Lib.Payment();
                        CGlobal.Copy(payment, newPayment);
                        newPayment.Amount           *= -1;
                        newPayment.OriginalPaymentId = payment.PaymentId;

                        cNewPayment.Add(newPayment);

                        RadGridPayment.Rebind();
                    }
                    else
                    {
                        ShowMessage("Negative price can't reverse");
                    }
                }
                break;
            }
        }
Beispiel #4
0
 protected void Refresh(object sender, EventArgs e)
 {
     RadGridPayment.Rebind();
 }