コード例 #1
0
ファイル: VendorController.cs プロジェクト: priceLiu/MulitNop
        public ActionResult List(GridCommand command, VendorListModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCatalog)
                 && !_permissionService.Authorize(StandardPermissionProvider.ManageVendor) //add by hz
                )
                return AccessDeniedView();

            var vendors = _vendorService.GetAllVendors(model.SearchVendorName,
                command.Page - 1, command.PageSize, customerVendorId, true);
            var gridModel = new GridModel<VendorModel>
            {
                Data = vendors.Select(x => x.ToModel()),
                Total = vendors.TotalCount
            };
            return new JsonResult
            {
                Data = gridModel
            };
        }
コード例 #2
0
ファイル: VendorController.cs プロジェクト: priceLiu/MulitNop
 public ActionResult List()
 {
     if (!_permissionService.Authorize(StandardPermissionProvider.ManageCatalog)
         && !_permissionService.Authorize(StandardPermissionProvider.ManageVendor) //add by hz
         )
         return AccessDeniedView();
     var model = new VendorListModel();
     model.IsVendorManager = (customerVendorId > 0) ? true : false;
     var vendors = _vendorService.GetAllVendors(null, 0, _adminAreaSettings.GridPageSize, customerVendorId, true );
     model.Vendors = new GridModel<VendorModel>
     {
         Data = vendors.Select(x => x.ToModel()),
         Total = vendors.TotalCount
     };
     return View(model);
 }