示例#1
0
        public ActionResult DiscountCommodityInfoContent(string par1, string par2, string par3, string par4)
        {
            //Request
            string opeType = par1;
            string pageIndex = par2;
            string size = string.IsNullOrEmpty(par3) ? "10" : par3;
            string searchVale = par4;

            int iSize = int.Parse(size);

            IEnumerable<dynamic> list = new AdminDiscountService().CommodityRelevanceDiscountListOpe(opeType, int.Parse(pageIndex), iSize, searchVale);

            //Check
            bool lastFlag = list.Count() < iSize;

            var resultNa = list.Select(x =>
            {
                return new
                {
                    ID = x.ID,
                    MID = x.MID,
                    StoreID = x.StoreID,
                    Title = x.Title,
                    Price = x.Price,
                    Intro = x.Intro,
                    Remark = x.Remark,
                    Photo = x.Photo,
                    Flag = x.Flag,
                    DiscountFlag = x.DiscountFlag,
                    PostType = x.PostType,
                    iOrder = x.iOrder,
                    OpeDate = DateTime.Parse(x.OpeDate.ToString()),
                    State = x.State,
                    Stock = x.Stock,
                    DISCOUNTVALUE = x.DISCOUNTVALUE == null ? string.Empty : x.DISCOUNTVALUE,
                    DISCOUNTPRICE = x.DISCOUNTPRICE,
                    DISCOUNTCOUNT = x.DISCOUNTCOUNT
                };
            });

            return Content(JsonConvert.SerializeObject(new { List = resultNa, IsLast = lastFlag.ToString() }));
        }