示例#1
0
 /// <summary>
 /// 编辑
 /// </summary>
 /// <param name="vm"></param>
 /// <returns></returns>
 public ActionResult Edit(GoodsImageVM vm)
 {
     vm.GoodsImage = _GoodsImageService.GetById(vm.Id) ?? new GoodsImage();
     vm.ImgInfo    = vm.GoodsImage.BaseImage ?? new BaseImage();
     if (vm.GoodsImage.GoodsId == 0)
     {
         vm.GoodsImage.GoodsId = vm.GoodsId;
     }
     return(View(vm));
 }
示例#2
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <param name="vm"></param>
        /// <param name="pn"></param>
        /// <returns></returns>
        public ActionResult List(GoodsImageVM vm, int pn = 1)
        {
            int totalCount,
                pageIndex = pn,
                pageSize  = PagingConfig.PAGE_SIZE;
            var list      = _GoodsImageService.GetManagerList(vm.Id, pageIndex, pageSize, out totalCount);
            var paging    = new Paging <GoodsImage>()
            {
                Items = list,
                Size  = PagingConfig.PAGE_SIZE,
                Total = totalCount,
                Index = pn,
            };

            vm.Paging = paging;
            return(View(vm));
        }