Example #1
0
        public async Task OnGetAsync(long?id)
        {
            if (id.HasValue)
            {
                Dto = await _service.GetByIdAsync(id.Value);

                if (Dto == null)
                {
                    throw new KuDataNotFoundException();
                }
                BindBoards       = (await _service.GetAdvertisementBoardsAsync(Dto.Id)).Select(x => x.Id).ToArray();
                ViewData["Mode"] = "Edit";
            }
            else
            {
                Dto = new AdvertisementDto();
                ViewData["Mode"] = "Add";
            }

            //广告位列表取得
            Boards = await _boardService.GetListAsync(new AdvertisementBoardSearch { IsDeleted = false }, null);

            if (BindBoards == null)
            {
                BindBoards = new long[] { };
            }
        }
Example #2
0
 public async Task OnGetAsync(long?id)
 {
     //广告位列表取得
     Boards = await _boardService.GetListAsync(new AdvertisementBoardSearch { IsDeleted = false }, null);
 }
Example #3
0
        public async Task <IActionResult> OnPostDataAsync(int page, int rows, AdvertisementBoardSearch where)
        {
            var data = await _service.GetListAsync(page, rows, where, null);

            return(PagerData(data.items, page, rows, data.count));
        }