Example #1
0
        public ActionResult OrderList(string startTime, string endTime, string orderCode, int receiptCountry = 0, int orderStatus = 1, int page = 1)
        {
            OrderQueryInfo queryInfo = new OrderQueryInfo();

            if (string.IsNullOrEmpty(startTime) || string.IsNullOrEmpty(endTime))
            {
                queryInfo.startTime = DateTime.Now.AddMonths(-3);
                queryInfo.endTime   = DateTime.Now;
            }
            else
            {
                queryInfo.startTime = DateTime.Parse(startTime);
                queryInfo.endTime   = DateTime.Parse(endTime);
            }
            queryInfo.orderCode  = orderCode;
            queryInfo.orderSatus = orderStatus;
            queryInfo.SupplierId = CurrentUser.SupplierID;

            ViewBag.QueryInfo      = queryInfo;
            ViewBag.ReceiptCountry = receiptCountry;
            ViewBag.Page           = page;

            try
            {
                if (receiptCountry == 1)
                {
                    ViewBag.ChinaOrder = bll.GetOrderList(queryInfo, new PageDTO()
                    {
                        PageIndex = PageNo, PageSize = 20
                    }, LanguageEnum.SimplifiedChinese, 1);

                    // ViewBag.HKOrder = bll.GetOrderList(queryInfo, new PageDTO() { PageIndex = page, PageSize = 20 }, LanguageEnum.TraditionalChinese, 2);
                }
                else if (receiptCountry == 2)
                {
                    ViewBag.ChinaOrder = bll.GetOrderList(queryInfo, new PageDTO()
                    {
                        PageIndex = page, PageSize = 20
                    }, LanguageEnum.SimplifiedChinese, 1);

                    //ViewBag.HKOrder = bll.GetOrderList(queryInfo, new PageDTO() { PageIndex = PageNo, PageSize = 20 }, LanguageEnum.TraditionalChinese, 2);
                }
                else
                {
                    ViewBag.ChinaOrder = bll.GetOrderList(queryInfo, new PageDTO()
                    {
                        PageIndex = 1, PageSize = 20
                    }, LanguageEnum.SimplifiedChinese, 1);

                    //ViewBag.HKOrder = bll.GetOrderList(queryInfo, new PageDTO() { PageIndex = 1, PageSize = 20 }, LanguageEnum.TraditionalChinese, 2);
                }

                var totalCN = bll.GetOrderTotal(queryInfo, LanguageEnum.SimplifiedChinese, 1);
                //var totalHK = bll.GetOrderTotal(queryInfo, LanguageEnum.TraditionalChinese, 2);
                ViewBag.OrderTotalCN = totalCN;
                //ViewBag.OrderTotalHK = totalHK;
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(View());
        }