示例#1
0
        public ActionResult Index(int page = 1, string name = null)
        {
            int pageSize = 10;
            var list     = _worksService.GetListAsync(page, pageSize, name);

            ViewBag.Total      = list.Total;
            ViewBag.PageIndex  = page;
            ViewBag.TotalPages = Math.Ceiling(list.Total * 1.0 / pageSize);
            return(View(list.Data));
        }
示例#2
0
        public ActionResult Index(int page = 1, int major = -1, string keyword = null)
        {
            int pageSize = 10;
            var list     = _worksService.GetListAsync(page, pageSize, major, keyword);

            ViewBag.Total      = list.Total;
            ViewBag.PageIndex  = page;
            ViewBag.TotalPages = Math.Ceiling(list.Total * 1.0 / pageSize);

            ViewBag.Keyword   = keyword;
            ViewBag.majorList = _majorService.GetAllAsync();
            ViewBag.major     = major;
            return(View(list.Data));
        }
示例#3
0
        public async Task <IHttpActionResult> Get([FromUri] GetWorksList dto)
        {
            var resp = await _worksService.GetListAsync(dto);

            return(Ok(resp));
        }