コード例 #1
0
        public JsonResult List(int page, int rows, string orderNum, int orderStatus)
        {
            OrderSynthesisQuery opQuery = new OrderSynthesisQuery();

            opQuery = new OrderSynthesisQuery()
            {
                PageSize    = rows,
                PageNo      = page,
                status      = orderStatus,
                OrderNumber = orderNum,
                ShopId      = base.CurrentSellerManager.ShopId.ToString()
            };

            PageModel <OrderSynthesis> opModel = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesisList(opQuery);
            var array =
                from item in opModel.Models.ToArray()
                select new
            {
                Id          = item.Id,
                ProductName = item.ProductName,
                OrderNum    = item.OrderNumber,
                //ProductPrice = item.Price,
                ProductPrice = (decimal.Parse(item.Price) * decimal.Parse(item.ProductCount)).ToString("0.00"),
                Status       = item.Status,
                ProductCount = item.ProductCount,
                Email        = item.Email,
                CompanyName  = item.CompanyName
            };

            return(Json(new { rows = array, total = opModel.Total }));
        }
コード例 #2
0
        /// <summary>
        /// 采购订单列表查询
        /// </summary>
        /// <param name="opQuery"></param>
        /// <returns></returns>
        public Model.PageModel <OrderSynthesis> GetOrderSynthesisList(OrderSynthesisQuery opQuery)
        {
            int num = 0;
            IQueryable <OrderSynthesis> orderP = context.OrderSynthesis.AsQueryable <OrderSynthesis>();

            if (!string.IsNullOrWhiteSpace(opQuery.OrderNumber))
            {
                orderP =
                    from d in orderP
                    where d.OrderNumber.Contains(opQuery.OrderNumber)
                    orderby d.OrderTime descending
                    select d;
            }

            if (!string.IsNullOrWhiteSpace(opQuery.ShopId))
            {
                orderP =
                    from d in orderP
                    where d.ZhifuImg.Equals(opQuery.ShopId)
                    orderby d.OrderTime descending
                    select d;
            }

            if (!string.IsNullOrWhiteSpace(opQuery.status.ToString()) && opQuery.status != -1)
            {
                orderP =
                    from d in orderP
                    where d.Status == opQuery.status
                    orderby d.OrderTime descending
                    select d;
            }

            if (!string.IsNullOrWhiteSpace(opQuery.userId.ToString()) && opQuery.userId != 0)
            {
                orderP =
                    from d in orderP
                    where d.UserId == opQuery.userId
                    orderby d.OrderTime descending
                    select d;
            }
            orderP = orderP.GetPage(out num, opQuery.PageNo, opQuery.PageSize, (IQueryable <OrderSynthesis> d) =>
                                    from o in d
                                    orderby o.OrderTime descending
                                    select o);
            return(new PageModel <OrderSynthesis>()
            {
                Models = orderP,
                Total = num
            });
        }
コード例 #3
0
        public JsonResult List(int page, int rows, string orderNum, int orderStatus)
        {
            OrderSynthesisQuery opQuery = new OrderSynthesisQuery();
            DateTime            dt;

            opQuery = new OrderSynthesisQuery()
            {
                PageSize = rows,
                PageNo   = page,

                status      = orderStatus,
                OrderNumber = orderNum
            };

            PageModel <OrderSynthesis> opModel = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesisList(opQuery);
            var array =
                from item in opModel.Models.ToArray()
                select new { Id = item.Id, ProductName = item.ProductName, OrderNum = item.OrderNumber, ProductPrice = item.Price, Status = item.Status, ProductCount = item.ProductCount, Email = item.Email, CompanyName = item.CompanyName };

            return(Json(new { rows = array, total = opModel.Total }));
        }
コード例 #4
0
        /// <summary>
        /// 我的订单管理列表
        /// </summary>
        /// <param name="orderDate"></param>
        /// <param name="orderStatus"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageNo"></param>
        /// <param name="productName"></param>
        /// <returns></returns>
        public ActionResult ManageMent(int orderStatus = -1, int pageSize = 10, int pageNo = 1, string orderNum = "")
        {
            OrderSynthesisQuery opQuery = new OrderSynthesisQuery();

            opQuery = new OrderSynthesisQuery()
            {
                userId      = base.CurrentUser.Id,
                PageSize    = pageSize,
                PageNo      = pageNo,
                status      = orderStatus,
                OrderNumber = orderNum
            };
            PageModel <OrderSynthesis> opModel = ServiceHelper.Create <IOrderSynthesisService>().GetOrderSynthesisList(opQuery);
            PagingInfo pagingInfo = new PagingInfo()
            {
                CurrentPage  = pageNo,
                ItemsPerPage = pageSize,
                TotalItems   = opModel.Total
            };

            ViewBag.pageInfo = pagingInfo;
            return(View(opModel.Models));
        }