Пример #1
0
        public ActionResult <DataRes <List <SingleProductSell> > > GetList(OrderReq req)
        {
            var res = new DataRes <List <SingleProductSell> >()
            {
                code = ResCode.Success
            };

            if (req != null)
            {
                using (var uow = _uowProvider.CreateUnitOfWork())
                {
                    string sql = "select x.Plateform,x.UserAccount,x.SaleOrderCode," +
                                 "x.ShippingMethodPlatform, x.ShippingMethod, x.WarehouseCode," +
                                 "x.DatePaidPlatform, x.PlatformShipTime, x.DateLatestShip, x.Currency," +
                                 "x.CountryCode, ProductCount,a.ProductSku, a.Qty,c.pcrProductSku SubProductSku," +
                                 " a.Qty * c.PcrQuantity SubQty, b.WarehouseId " +
                                 "from EC_SalesOrder x join EC_SalesOrderDetail a on x.OrderId = a.OrderId " +
                                 "join EC_SkuRelation b on a.ProductSku = b.ProductSku " +
                                 "join EC_SkuRelationItems c on b.relationid = c.relationid " +
                                 "order by x.SaleOrderCode";
                    var    repository = uow.GetRepository <SingleProductSell>();
                    string orderStr   = req.order + (req.order.reverse ? " desc" : "");
                    res.data = repository.ListFromSql(sql, FilterNode.ListToString(req.query), orderStr).ToList();
                }
            }
            else
            {
                res.code = ResCode.NoValidate;
                res.msg  = ResMsg.ParameterIsNull;
            }
            return(res);
        }
        public ActionResult <PageDataRes <UsTagTypeInventory> > GetPage(PageReq req)
        {
            var res = new PageDataRes <UsTagTypeInventory>()
            {
                code = ResCode.Success
            };

            if (req != null)
            {
                using (var uow = _uowProvider.CreateUnitOfWork())
                {
                    var repository = uow.GetCustomRepository <IUsTagTypeInventoryRepository>();
                    var page       = repository.GetPage(req.pageNum, req.pageSize, FilterNode.ListToString(req.query));
                    res = PageMapper <UsTagTypeInventory> .ToPageDateRes(page);
                }
            }
            else
            {
                res.code = ResCode.NoValidate;
                res.msg  = ResMsg.ParameterIsNull;
            }
            return(res);
        }