public JsonResult List([DataSourceRequest] DataSourceRequest request)
        {
            var result   = _questionService.All().Select(Mapper.Map <Question, QuestionDto>);
            var dsResult = result.ToDataSourceResult(request);

            return(Json(dsResult));
        }
        public ActionResult Index(int?pageIndex)
        {
            int?languageId = null;
            var model      = _Service.All(null, false, null, null, pageIndex, 10, languageId);

            pageIndex         = pageIndex ?? 1;
            ViewBag.pageIndex = pageIndex;
            ViewBag.TotalPage = model.Total;
            return(View(model.Questions));
        }
Ejemplo n.º 3
0
        public ActionResult Index(string searchKey, DateTime?fromDate, DateTime?toDate, int?pageIndex, int?languageId)
        {
            var model = _questionService.All(searchKey, null, fromDate, toDate, pageIndex, 20, languageId);

            pageIndex            = pageIndex ?? 1;
            ViewBag.pageIndex    = pageIndex;
            ViewBag.TotalPage    = model.Total;
            ViewBag.languageId   = languageId ?? 1;
            ViewBag.SearchKey    = string.IsNullOrWhiteSpace(searchKey) ? string.Empty : searchKey;
            ViewBag.FromDate     = fromDate?.ToString("MM/dd/yyyy") ?? null;
            ViewBag.ToDate       = toDate?.ToString("MM/dd/yyyy") ?? null;
            ViewBag.Quanlycauhoi = "active";
            return(View(model.Questions));
        }
Ejemplo n.º 4
0
 public async Task <ActionResult <List <Question> > > All()
 {
     return(await _questionService.All());
 }