Ejemplo n.º 1
0
        public ActionResult OrderDetail(int pageId, string orderGuid)
        {
            orderShared os = new orderShared(db);
            addressShared ads = new addressShared(db);

            if (!string.IsNullOrWhiteSpace(orderGuid))
            {

                var orderItem = os.getOrderByGuid(orderGuid);

                if (orderItem != null)
                {
                    pageShared ps = new pageShared(db);
                    var pageItem = ps.getPageById(pageId);

                    var orderPage = ps.getPageByType(pageType.accountOrders, langId);

                    helperOrderDetail pageHelper = new helperOrderDetail();

                    ps.pageTitleBind(pageItem, pageHelper, langId);
                    pageHelper.setTitle(pageItem.name);
                    pageHelper.detail = pageItem.detail;

                    pageHelper.orderSummary = os.getOrderSummary(orderItem);

                    pageHelper.orderNo = orderItem.orderNo;
                    pageHelper.orderStatuHtml = os.getOrderStatuString(orderItem.orderStatu);

                    // On Cargo Add Track Url
                    if ((orderStatu)orderItem.orderStatu == orderStatu.onCargo && !string.IsNullOrWhiteSpace(orderItem.shipmentNo))
                    {
                        pageHelper.orderStatuHtml = pageHelper.orderStatuHtml + " " + os.getCargoTrackHtml(orderItem);
                    }

                    pageHelper.salesAgreement = orderItem.salesAgreement;
                    pageHelper.preSalesAgreement = orderItem.preSalesAgreement;

                    var deliveryAddressItem = ads.getAddressHtmlFromObj(orderItem.deliveryAddressId, orderItem.deliveryAddressObj);
                    var billingAddressItem = ads.getAddressHtmlFromObj(orderItem.billingAddressId, orderItem.billingAddressObj);

                    pageHelper.deliveryAddress = ads.getAddressHtml(deliveryAddressItem, AddressHtmlType.orderDetail, this);
                    pageHelper.billingAddress = ads.getAddressHtml(billingAddressItem, AddressHtmlType.orderDetail, this);

                    pageHelper.orderNote = orderItem.orderNote;

                    topCart cartItem = (topCart)ViewData["topCart"];

                    if (cartItem.isRegisteredUser)
                    {
                        pageHelper.isGoBackExist = true;

                        var mainAccountPage = ps.getPageByType(pageType.account, langId);
                        var orderListPage = ps.getPageByType(pageType.accountOrders, langId);

                        pageHelper.goBackLink = langCode + "/" + mainAccountPage.url + "/" + orderListPage.url + ".html";

                    }

                    return View(pageHelper);

                }
            }

            return null;
        }
Ejemplo n.º 2
0
        public ActionResult Complete(int pageId)
        {
            helperComplete pageHelper = new helperComplete();
            orderShared os = new orderShared(db);
            checkoutShared cs = new checkoutShared(db);
            checkoutProcess checkoutItem = (checkoutProcess)Session["checkoutProcess"];

            if (Request.QueryString["orderGuid"] != null)
            {
                string orderNo = "";
                string orderDetailLink = "";

                sharedCheckoutItemLoad(pageId, pageHelper, checkoutItem);

                Session["checkoutProcess"] = null;

                var orderItem = os.getOrderByGuid(Request.QueryString["orderGuid"]);

                if (orderItem != null)
                {
                    // orderNo
                    orderNo = orderItem.orderNo;
                    pageHelper.detail = pageHelper.detail.Replace("[order_no]", orderNo);

                    // orderDetail Link
                    orderDetailLink = os.getOrderDetailLink(orderItem.orderGuid, langId, langCode);
                    pageHelper.detail = pageHelper.detail.Replace("[orderNoDetail]", Url.Content("~/" + orderDetailLink));

                    if (orderItem.paymentTypeId == (int)paymentOption.transfer)
                    {
                        pageHelper.isTransferOrder = true;
                        pageHelper.transferAcountHtml = cs.getTransferInfoHtml(orderItem.eftId, langId, this, TransferHtmlType.orderDetail);
                    }

                    return View(pageHelper);
                }
            }

            // Return Basket
            return returnBasketMainPage(null);
        }