Esempio n. 1
0
        public ActionResult BenXeList()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.QLDanhMuc))
            {
                return(AccessDeniedView());
            }
            var model = new BenXeListModel();

            model.AvailableStates = GetListOfProvince(true);
            return(View(model));
        }
Esempio n. 2
0
        public ActionResult BenXeList(DataSourceRequest command, BenXeListModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.QLDanhMuc))
            {
                return(AccessDeniedView());
            }

            var BenXes    = _benxeService.GetAll(model.ProvinceID, model.TenBenXe, command.Page - 1, command.PageSize);
            var gridModel = new DataSourceResult
            {
                Data = BenXes.Select(x =>
                {
                    var item = new BenXeModel();
                    BenXeToBenXeModel(x, item);
                    return(item);
                }),
                Total = BenXes.TotalCount
            };

            return(Json(gridModel));
        }