示例#1
0
        public PartialViewResult LoadExtraMemberInvoiceForm()
        {
            var blInvoice = new BLInvoice();

            var invoice = blInvoice.GetInvoiceByUserId(CurrentUserId, false);

            if (invoice != null)
            {
                int?lastOrderId = 0;

                var blShopCart = new BLShopCart();

                var lastOrderInfo = blShopCart.GetCheckoutStatus(CurrentUserId, invoice.Id, out lastOrderId);

                if (lastOrderInfo != null)
                {
                    blInvoice.UpdateInvoiceOrderStatus(lastOrderInfo, invoice.Id, true, lastOrderId.Value, true, true);
                }
            }

            var invoiceList = blInvoice.GetExtraMemberInvoiceFullInfoByUserId(CurrentUserId);

            if (invoiceList == null)
            {
                return(PartialView("_EmptyReviewOrder", new VMHandleErrorInfo
                {
                    ErrorMessage = "There is no balance to pay for extra members."
                }));
            }

            return(PartialView("ExtraMemberReviewOrderManagement", invoiceList));
        }
示例#2
0
        // Recept Log out
        public PartialViewResult LoadReceiptForm()
        {
            var blInvoice = new BLInvoice();

            //var invoice = blInvoice.GetInvoiceFullInfoByUserId(CurrentUserId, true);
            //invoice.TransactionNo = "12355787";
            //invoice.Received = DateTime.Now.Date.ToShortDateString();

            var invoice = blInvoice.GetInvoiceByUserId(CurrentUserId, false);

            if (invoice != null)
            {
                int?lastOrderId = 0;

                var blShopCart    = new BLShopCart();
                var lastOrderInfo = blShopCart.GetCheckoutStatus(CurrentUserId, invoice.Id, out lastOrderId);

                if (lastOrderInfo != null)
                {
                    blInvoice.UpdateInvoiceOrderStatus(lastOrderInfo, invoice.Id, true, lastOrderId.Value, true, true);

                    invoice = blInvoice.GetInvoiceFullInfoById(invoice.Id);

                    invoice.Received      = lastOrderInfo.Order.Received;
                    invoice.TransactionNo = lastOrderInfo.Order.Tx;

                    return(PartialView("LastReceiptForm", invoice));
                }
            }

            return(PartialView("LastReceiptForm", invoice));
        }
示例#3
0
        //Invoice List
        public ActionResult LoadReceiptList()
        {
            var blInvoice = new BLInvoice();

            var invoice = blInvoice.GetInvoiceByUserId(CurrentUserId, false);

            if (invoice != null)
            {
                int?lastOrderId = 0;

                var blShopCart    = new BLShopCart();
                var lastOrderInfo = blShopCart.GetCheckoutStatus(CurrentUserId, invoice.Id, out lastOrderId);

                if (lastOrderInfo != null)
                {
                    //Update all data in one transaction
                    blInvoice.UpdateInvoiceOrderStatus(lastOrderInfo, invoice.Id, true, lastOrderId.Value, true, true);
                    invoice.Received      = lastOrderInfo.Order.Received;
                    invoice.TransactionNo = lastOrderInfo.Order.Tx;
                }
            }

            var invoiceIdList = blInvoice.GetInvoiceFullInfoByUserAndStatus(CurrentUserId, true);

            if (invoiceIdList != null)
            {
                return(View("LastReceiptList", invoiceIdList));
            }

            return(PartialView("_EmptyReviewOrder", new VMHandleErrorInfo
            {
                ErrorMessage = "There is no receipt."
            }));
        }
示例#4
0
        public ActionResult UpdatePayStatusTeamFullInfoManagement()
        {
            var blInvoice = new BLInvoice();

            var invoiceList = blInvoice.GetInvoiceIds(false);

            if (invoiceList != null)
            {
                foreach (var invoiceId in invoiceList.Ids)
                {
                    int?lastOrderId = 0;

                    var blShopCart    = new BLShopCart();
                    var lastOrderInfo = blShopCart.GetCheckoutStatus(invoiceId, out lastOrderId);

                    if (lastOrderInfo != null)
                    {
                        //Update all data in one transaction
                        blInvoice.UpdateInvoiceOrderStatus(lastOrderInfo, invoiceId, true, lastOrderId.Value, true, true);
                    }
                }
            }

            return(View("TeamFullInfoManagement", new VmTeamFullInfoManagement()));
        }
示例#5
0
        public PartialViewResult LoadInvoiceForm()
        {
            var blInvoice = new BLInvoice();

            var invoice = blInvoice.GetInvoiceByUserId(CurrentUserId, false);

            if (invoice != null)
            {
                int?lastOrderId = 0;

                var blShopCart = new BLShopCart();

                var lastOrderInfo = blShopCart.GetCheckoutStatus(CurrentUserId, invoice.Id, out lastOrderId);

                if (lastOrderInfo != null)
                {
                    blInvoice.UpdateInvoiceOrderStatus(lastOrderInfo, invoice.Id, true, lastOrderId.Value, true, true);

                    invoice = blInvoice.GetInvoiceFullInfoByUserId(CurrentUserId, false);
                }
            }

            var invoiceList = blInvoice.GetInvoiceFullInfoByUserId(CurrentUserId, false);

            if (invoiceList == null)
            {
                return(PartialView("_EmptyReviewOrder", new VMHandleErrorInfo
                {
                    ErrorMessage = "There are no team(s) to pay." +
                                   "Please, complete all team member(s) registration forms before you could proceed to payment"
                }));
            }


            List <VmTeamSelection> teamSelectionList = new List <VmTeamSelection>();

            foreach (var item in invoiceList.InvoiceDetails)
            {
                teamSelectionList.Add(new VmTeamSelection
                {
                    Checked     = item.IsChecked,
                    IsFirstTeam = item.IsFirstTeam,
                    TeamId      = item.TeamId
                });
            }

            blInvoice.ProcessInvoice(CurrentUserId, invoiceList.LastCheckedId, teamSelectionList);
            invoiceList = blInvoice.GetInvoiceFullInfoByUserId(CurrentUserId, false);

            return(PartialView("ReviewOrderManagement", invoiceList));
        }