Exemple #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 }));
        }
Exemple #2
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 }));
        }
Exemple #3
0
        public HttpResponseMessage GetNegotiateOrders(int page, int pageSize, int status, bool isDes = true, EnumOrderSearchOrderBy orderByAll = EnumOrderSearchOrderBy.OrderByAddTime)
        {
            OrderSearchCondition OSC = new OrderSearchCondition()
            {
                Page         = page,
                PageCount    = pageSize,
                Status       = status,
                Shipstatuses = new [] { 3, -3 },
                IsDescending = isDes,
                OrderBy      = orderByAll
            };
            var orderList = _orderService.GetOrdersByCondition(OSC).Select(a => new
            {
                a.Ordercode,
                a.Id,
                a.Ordertype,
                a.Status,
                a.Shipstatus,
                a.Agentname,
                a.Agenttel,
                a.Busname,
                a.Adddate,
                a.OrderDetail.Price,
                a.OrderDetail.RecCommission,
                a.OrderDetail.Commission,
                a.OrderDetail.Dealcommission
            }).ToList();
            var totalCount = _orderService.GetOrderCount(OSC);

            return(PageHelper.toJson(new{ OrderList = orderList, TotalCount = totalCount, Condition = OSC }));
        }
Exemple #4
0
        public HttpResponseMessage GetAllRecommonOrders(EnumOrderType type, int page = 1, int pageSize = 10, bool isDes = true, EnumOrderSearchOrderBy orderByAll = EnumOrderSearchOrderBy.OrderById)
        {
            OrderSearchCondition OSC = new OrderSearchCondition()
            {
                IsDescending = isDes,
                Ordertype    = type,
                OrderBy      = orderByAll,
                Page         = page,
                PageCount    = pageSize
            };
            var list = _orderService.GetOrdersByCondition(OSC).Select(p => new
            {
                p.Ordercode,
                p.Ordertype,
                p.Status,
                p.Shipstatus,
                p.Agentname,
                p.Agenttel,
                p.Busname,
                p.OrderDetail.Price,
                p.OrderDetail.RecCommission,
                p.OrderDetail.Commission,
                p.OrderDetail.Dealcommission
            }).ToList();
            var totalCount1 = _orderService.GetOrderCount(OSC);

            return(PageHelper.toJson(new { List = list, Condition = OSC, totalCount = totalCount1 }));
        }
Exemple #5
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 });
 }
Exemple #6
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 });
        }
 public HttpResponseMessage GetNegotiateOrders(int page, int pageSize, int status, bool isDes = true, EnumOrderSearchOrderBy orderByAll = EnumOrderSearchOrderBy.OrderByAddTime)
 {            
     OrderSearchCondition OSC = new OrderSearchCondition()
     {                
         Page = page,
         PageCount = pageSize,
         Status = status,
         Shipstatuses = new []{3,-3},
         IsDescending = isDes,
         OrderBy = orderByAll
     };          
     var orderList = _orderService.GetOrdersByCondition(OSC).Select(a => new
     {
         a.Ordercode,
         a.Id,
         a.Ordertype,
         a.Status,
         a.Shipstatus,
         a.Agentname,
         a.Agenttel,
         a.Busname,
         a.Adddate,
         a.OrderDetail.Price,
         a.OrderDetail.RecCommission,
         a.OrderDetail.Commission,
         a.OrderDetail.Dealcommission
     }).ToList();
     var totalCount = _orderService.GetOrderCount(OSC);
     return PageHelper.toJson(new{OrderList=orderList,TotalCount=totalCount,Condition=OSC});
 }
 public HttpResponseMessage GetAllRecommonOrders(EnumOrderType type, int page = 1, int pageSize = 10, bool isDes = true, EnumOrderSearchOrderBy orderByAll = EnumOrderSearchOrderBy.OrderById)
 {
     OrderSearchCondition OSC = new OrderSearchCondition()
     {
         IsDescending = isDes,
         Ordertype = type,
         OrderBy = orderByAll,
         Page = page,
         PageCount = pageSize
     };          
     var list = _orderService.GetOrdersByCondition(OSC).Select(p => new 
     {
         p.Ordercode,
         p.Ordertype,
         p.Status,
         p.Shipstatus,
         p.Agentname,
         p.Agenttel,
         p.Busname,
         p.OrderDetail.Price,
         p.OrderDetail.RecCommission,
         p.OrderDetail.Commission,
         p.OrderDetail.Dealcommission
     }).ToList();
     var totalCount1 = _orderService.GetOrderCount(OSC);
     return PageHelper.toJson(new { List = list, Condition = OSC, totalCount = totalCount1 });
 }