Пример #1
0
        public JsonResult GetOrderList(RequestPrams param)
        {
            var outResult = this._orderRepository.QueryOrders(Common.UserHelper.Instance.getUserId().ToString(), param.PageIndex, param.PageSize);

            //return Json(outResult, JsonRequestBehavior.AllowGet);
            return(new ToJsonResult
            {
                Data = outResult,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                FormateStr = "yyyy-MM-dd HH:mm:ss"
            });
        }
Пример #2
0
        public JsonResult GetHistory(RequestPrams param)
        {
            var outResult = this._orderRepository.QueryOrders(Common.UserHelper.Instance.getUserId().ToString(), param.PageIndex, param.PageSize);

            if (outResult != null)
            {
                for (int index = 0; index <= outResult.Count - 1; index++)
                {
                    var item    = _orderRepository.QueryOrderItems(outResult[index].Id);
                    var itemAll = item.Select(o => { return(o.ProductNum + " x " + o.ProductName); });
                    outResult[index].ItemAll = string.Join("、", itemAll.ToArray());
                }
            }
            //return Json(outResult, JsonRequestBehavior.AllowGet);
            return(new ToJsonResult
            {
                Data = outResult,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                FormateStr = "yyyy-MM-dd HH:mm:ss"
            });
        }