Example #1
0
        public ActionResult ListNhaXe()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.QLNhaXe))
            {
                return(AccessDeniedView());
            }

            var model = new NhaXeListModel();

            return(View(model));
        }
Example #2
0
        public ActionResult ListNhaXe(DataSourceRequest command, NhaXeListModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.QLNhaXe))
            {
                return(AccessDeniedView());
            }

            var nhaxes = _nhaxeService.GetAllNhaXe(model.TimTenNhaXe,
                                                   command.Page - 1, command.PageSize, false, _workContext.CurrentCustomer.Id);
            var gridModel = new DataSourceResult
            {
                Data  = nhaxes.Select(x => x.ToModel()),
                Total = nhaxes.TotalCount
            };

            return(Json(gridModel));
        }