Ejemplo n.º 1
0
 public HttpResponseMessage GetCount(int? page = 1,
     int? pageCount = 10,
     string ids = "",
     bool isDescending = false,
     string orderNum = "",
     EnumOrderStatus? status = null,
     string deliveryAddress = "",
     bool? isPrint = null,
     string phoneNumber = "",
     EnumOrderType? type = null,
     EnumPayType? payType = null,
     decimal? locationX = null,
     decimal? locationY = null,
     DateTime? addTimeBegin = null,
     DateTime? addTimeEnd = null,
     EnumOrderSearchOrderBy orderBy = EnumOrderSearchOrderBy.OrderById)
 {
     var condition = new OrderSearchCondition
     {
         AddTimeBegin = addTimeBegin,
         AddTimeEnd = addTimeEnd,
         DeliveryAddress = deliveryAddress,
         Ids = string.IsNullOrEmpty(ids) ? null : ids.Split(',').Select(int.Parse).ToArray(),
         IsDescending = isDescending,
         IsPrint = isPrint,
         LocationX = locationX,
         LocationY = locationY,
         OrderBy = orderBy,
         OrderNum = orderNum,
         Page = page,
         PageCount = pageCount,
         PayType = payType,
         PhoneNumber = phoneNumber,
         Type = type,
         Status = status
     };
     var count = _OrderService.GetOrderCount(condition);
     return PageHelper.toJson(new { TotalCount = count, Condition = condition });
 }
Ejemplo n.º 2
0
 public virtual bool IsNotWaitRefundNotifyIfApplyRefund(string OrderNo, EnumPayType PayType)
 {
     return(true);
 }
Ejemplo n.º 3
0
        public HttpResponseMessage GetByCondition(int? page = 1,
                                                    int? pageCount = 10,
                                                    string ids ="",
                                                    bool isDescending = false,
                                                    string orderNum = "",
                                                    EnumOrderStatus? status = null,
                                                    string deliveryAddress = "",
                                                    bool? isPrint = null,
                                                    string phoneNumber = "",
                                                    EnumOrderType? type = null,
                                                    EnumPayType? payType = null,
                                                    decimal? locationX = null,
                                                    decimal? locationY = null,
                                                    DateTime? addTimeBegin = null,
                                                    DateTime? addTimeEnd = null,
                                                    EnumOrderSearchOrderBy orderBy = EnumOrderSearchOrderBy.OrderById)
        {
            var condition = new OrderSearchCondition
            {
                AddTimeBegin = addTimeBegin,
                AddTimeEnd = addTimeEnd,
                DeliveryAddress = deliveryAddress,
                Ids = string.IsNullOrEmpty(ids)?null:ids.Split(',').Select(int.Parse).ToArray(),
                IsDescending = isDescending,
                IsPrint = isPrint,
                LocationX = locationX,
                LocationY = locationY,
                OrderBy = orderBy,
                OrderNum = orderNum,
                Page = page,
                PageCount = pageCount,
                PayType = payType,
                PhoneNumber = phoneNumber,
                Type = type,
                Status = status
            };
            var model = _OrderService.GetOrdersByCondition(condition).Select(c => new OrderModel
            {

                Id = c.Id,

                OrderNum = c.OrderNum,

                TotalPrice = c.TotalPrice,

                TransCost = c.TransCost,

                ProductCost = c.ProductCost,

                Discount = c.Discount,

                Status = c.Status,

                DeliveryAddress = c.DeliveryAddress,

                IsPrint = c.IsPrint,

                PhoneNumber = c.PhoneNumber,

                Adduser = new UserModel{Id = c.Adduser.Id,UserName = c.Adduser.UserName},

                Addtime = c.Addtime,

                Upduser = new UserModel { Id = c.Upduser.Id, UserName = c.Upduser.UserName },

                Updtime = c.Updtime,

                //				Details = c.Details,

                //				Coupon = c.Coupon,

                Type = c.Type,

                PayType = c.PayType,

                LocationX = c.LocationX,

                LocationY = c.LocationY,
                Details = c.Details.Select(d => new OrderDetailModel()
                {
                    Count = d.Count,
                    Id = d.Id,
                    ProductId = d.Product.Id,
                    ProductName = d.Product.Name,
                    TotalPrice = d.TotalPrice,
                    UnitPrice = d.Product.Price,
                    Remark=d.Remark
                }).ToList()

            }).ToList();
            return PageHelper.toJson(new { List = model });
        }