public JsonResult List(int page, int rows, string name, int?position)
        {
            var templatePosition = (ProductDescriptionTemplateInfo.TemplatePosition?)position;
            var pageModel        = _iProductDescriptionTemplateService.GetTemplates(CurrentSellerManager.ShopId, page, rows, name, templatePosition);

            var dataGrid = new DataGridModel <ProductDescriptionTemplateModel>()
            {
                rows = pageModel.Models.ToArray().Select(item => new ProductDescriptionTemplateModel()
                {
                    HtmlContent  = item.Content,
                    Id           = item.Id,
                    Name         = item.Name,
                    Position     = (int)item.Position,
                    PositionText = item.Position.ToDescription()
                }),
                total = pageModel.Total
            };

            return(Json(dataGrid));
        }
示例#2
0
 /// <summary>
 /// 获取商家所有商品描述模板
 /// </summary>
 /// <param name="shopId"></param>
 /// <returns></returns>
 public static List <ProductDescriptionTemplate> GetDescriptionTemplatesByShopId(long shopId)
 {
     return(_productDescriptionTemplateService.GetTemplates(shopId).ToList().Map <List <ProductDescriptionTemplate> >());
 }