public JsonResult GetOrderList(string startDt, string endDt)
        {
            GmarketOrderBiz biz = new GmarketOrderBiz();
            List<GmarketOrderValueT> list = new List<GmarketOrderValueT>();

            int rows, page, packNo = 0, cloneItemNo = 0;

            if (startDt == null || startDt == string.Empty || endDt == null || endDt == string.Empty)
            {
                //값이 제대로 안 들어왔을 때 기본값은 일주일전 ~ 오늘
                startDt = DateTime.Today.AddDays(-7).ToString();
                endDt = DateTime.Today.ToString();
            }

            rows = Util.GetSafeInt(Request.Form["rows"]);
            page = Util.GetSafeInt(Request.Form["page"]);
            packNo = Util.GetSafeInt(Request.Form["packNo"]);
            cloneItemNo = Util.GetSafeInt(Request.Form["cloneItemNo"]);

            list = biz.MakeGmarketOrderList(MemberContext.CustomerNo, DateTime.Parse(startDt), DateTime.Parse(endDt), packNo, cloneItemNo, page, 10);
            JQGridResult result = new JQGridResult();

            if (list != null && list.Count > 0)
            {
                result.Count = Convert.ToInt64(list[0].TotalCnt);
                result.total = Math.Ceiling(Convert.ToDecimal(Convert.ToDecimal(list[0].TotalCnt) / 10));
                result.page = page;
                result.rows = (from e in list
                               select new
                               {
                                   ContrDate = e.ContrDate.Substring(0, 4) + "-" + e.ContrDate.Substring(4, 2) + "-" + e.ContrDate.Substring(6, 2),
                                   PackNo = e.PackNo.ToString(),
                                   ContrCount = e.ContrCount.ToString() + " 건",
                                   CancelCount = e.CancelCount.ToString() + " 건",
                                   AcntMoney = e.AcntMoney.ToString("C", CultureInfo.CreateSpecificCulture("ko-KR")),
                                   PayWay = e.PayWay
                               }).ToList();
            }

            return Json(result);
        }
        public ActionResult OrderDetail()
        {
            string orderDt = Request.QueryString["order_date"];
            string packNo = Request.QueryString["pack_no"];
            ViewBag.packId = packNo;
            ViewBag.orderDate = orderDt;

            int conPackNo = 0;
            if (int.TryParse(packNo, out conPackNo))
            {
                OrderDetailT orderDetail = new GmarketOrderBiz().MakeOrderDetailList(conPackNo, MemberContext.CustomerNo);
                List<DomesticDeliveryStatusT> domDelStat = orderDetail.DomesticDeliveryStatusList;
                ViewBag.totOrderCnt = orderDetail.ContrValue.ItemCnt;
                ViewBag.totItemPrice = orderDetail.ContrValue.TotItemPrice.ToString("C", CultureInfo.CreateSpecificCulture("ko-KR"));
                ViewBag.totDeliveryFee = orderDetail.ContrValue.TotDeliveryFee.ToString("C", CultureInfo.CreateSpecificCulture("ko-KR"));
                ViewBag.totPayMoney = orderDetail.ContrValue.PackTotPayMoney.ToString("C", CultureInfo.CreateSpecificCulture("ko-KR"));
                ViewBag.totOriPayMoney = orderDetail.ContrValue.PackOriginTotPayMoney.ToString("C", CultureInfo.CreateSpecificCulture("ko-KR"));
                ViewBag.totCancelMoney = orderDetail.ContrValue.PackCancelTotPayMoney.ToString("C", CultureInfo.CreateSpecificCulture("ko-KR"));

                ViewBag.payType = orderDetail.ContrValue.PayType;
                ViewBag.SttlName = orderDetail.ContrValue.SttlName;
                ViewBag.SttlNo = orderDetail.ContrValue.SttlNo;
                ViewBag.DepositNm = orderDetail.ContrValue.DepositNm;
                ViewBag.FinalDeposit = orderDetail.ContrValue.FinalDeposit;
                ViewBag.SttlWay = orderDetail.ContrValue.SttlWay;
                ViewBag.CardAcptDt = orderDetail.ContrValue.CardAcptDt.ToString("yyyy-MM-dd hh:mm:ss");
                ViewBag.ForeignInfo = orderDetail.ContrValue.ForeignInfo;

                var jsonData = new JavaScriptSerializer().Serialize(domDelStat);
                ViewBag.domDelJson = jsonData;
            }
            return View();
        }
        public JsonResult GetOrderDetailList(int packNo)
        {
            int page = int.Parse(Request.Form["page"]);
            OrderDetailT orderDetail = new GmarketOrderBiz().MakeOrderDetailList(packNo, MemberContext.CustomerNo);
            List<OrderDetailValueT> list = orderDetail.OrderDetailValueList;

            var fdata = from data in list
                        where (data.ListNo >= (page - 1) * 10) && (data.ListNo < (page * 10) + 1)
                        select data;

            var result = new
            {
                total = Math.Ceiling(Convert.ToDecimal(Convert.ToDecimal(list.Count()) / 10)),
                page = page,
                rows = (from e in fdata
                        select new
                        {
                            GmarketOrderNo = e.ContrNo,
                            GmarketItemId = e.MotherItemNo,
                            CloneItemId = e.CloneItemNo,
                            ExportSiteItemId = e.ExportSiteItemNo,
                            GmarketItemName = e.CloneItemName,
                            ExportSiteItemName = e.ExportSiteItemName,
                            OrderCnt = e.ContrAmt + " 개",
                            ItemPrice = e.ItemPrice.ToString("C", CultureInfo.CreateSpecificCulture("ko-KR")),
                            OrderPrice = e.TotalPrice.ToString("C", CultureInfo.CreateSpecificCulture("ko-KR")),
                            DeliveryFee = e.DeliveryFee.ToString("C", CultureInfo.CreateSpecificCulture("ko-KR")),
                            SellerId = e.SellerId,
                            SellerTel = e.SellerPhone,
                            SellerEmail = e.SellerEmail,
                            ExportSiteName = e.ExportSiteName,
                            ExportSiteOrderNo = e.ExportSiteOrderNo,
                            SelOptInfo = e.SelOptInfo,
                            OverseaAddress = e.OverseaAddress,
                            OverseaRcvName = e.OverseaRcvNm,
                            OverseaTelNo = e.OverseaPhone,
                            OverseaEmail = e.OverseaEmail,
                            CustKey = e.CustKey,
                            OverseaDeliveryState = e.OverseaDeliveryState,
                            OverseaDeliveryWay = e.OverseaDeliveryWay,
                            OverseaInvoiceNo = e.OverseaInvoiceNo,
                            OverseaTrackingURL = e.OverseaTrackingURL,
                            ViewItemUrl = e.ViewItemURL
                        }).ToArray()
            };

            return Json(result);
        }