Пример #1
0
        public ActionResult JuMeiMallAppend(JuMeiMallIndexRequest query)
        {
            var request = _container.Resolve <OperationJuMeiMall>();

            var model     = new JuMeiMallListModel();
            var recordSet = request.JuMeiMallService.Query(query);

            if (recordSet != null && recordSet.ModelList != null && recordSet.ModelList.Count > 0)
            {
                model.JuMeiMallList = recordSet.ModelList.ToList().Select(x => new JuMeiMallModel()
                {
                    commodityId    = x.commodityId,
                    commodityName  = x.commodityName,
                    images         = request.GetFirstImage(x.images),
                    commodityPrice = x.commodityPrice,
                    commodityRank  = x.commodityRank,
                    sellQuantity   = x.sellQuantity,
                    submitTime     = x.submitTime.ToString()
                }).ToList();
                model.totalCount = recordSet.ModelList.Count;
            }


            return(Json(model));
        }
Пример #2
0
        public DataTables <Commodity> Query(JuMeiMallIndexRequest request)
        {
            SqlParameter[] param =
            {
                new SqlParameter("@commodityName",  null),
                new SqlParameter("@pageIndex",      request.PageIndex),
                new SqlParameter("@pageSize",       request.PageSize),
                new SqlParameter("@commodityState", CommodityStates.putaway),
            };
            StoreProcedure sp = new StoreProcedure("P_getAllMallGoods", param);

            return(_databaseInstance.GetTables <Commodity>(sp));
        }