diff --git a/yy-admin-master/YY.Admin/ViewModels/Supplier/SupplierListViewModel.cs b/yy-admin-master/YY.Admin/ViewModels/Supplier/SupplierListViewModel.cs index 18918eb..2a53afb 100644 --- a/yy-admin-master/YY.Admin/ViewModels/Supplier/SupplierListViewModel.cs +++ b/yy-admin-master/YY.Admin/ViewModels/Supplier/SupplierListViewModel.cs @@ -37,6 +37,8 @@ public class SupplierListViewModel : BaseViewModel public DelegateCommand EditCommand { get; } public DelegateCommand DeleteCommand { get; } public DelegateCommand ToggleStatusCommand { get; } + public DelegateCommand PrevPageCommand { get; } + public DelegateCommand NextPageCommand { get; } public SupplierListViewModel( ISupplierService supplierService, @@ -47,17 +49,41 @@ public class SupplierListViewModel : BaseViewModel { _supplierService = supplierService; _dictSyncService = dictSyncService; - SearchCommand = new DelegateCommand(async () => { PageNo = 1; await LoadAsync(); }); + SearchCommand = new DelegateCommand(async () => + { + PageNo = 1; + RaisePropertyChanged(nameof(PageNo)); + await LoadAsync(); + }); ResetCommand = new DelegateCommand(async () => { FilterSupplierCode = FilterSupplierName = FilterSupplierShortName = FilterErpCode = FilterStatus = null; PageNo = 1; + RaisePropertyChanged(nameof(PageNo)); await LoadAsync(); }); AddCommand = new DelegateCommand(async () => await ShowAddDialogAsync()); EditCommand = new DelegateCommand(async s => await ShowEditDialogAsync(s)); DeleteCommand = new DelegateCommand(async s => await DeleteAsync(s)); ToggleStatusCommand = new DelegateCommand(async s => await ToggleStatusAsync(s)); + PrevPageCommand = new DelegateCommand(async () => + { + if (PageNo > 1) + { + PageNo--; + RaisePropertyChanged(nameof(PageNo)); + await LoadAsync(); + } + }); + NextPageCommand = new DelegateCommand(async () => + { + if ((long)PageNo * PageSize < Total) + { + PageNo++; + RaisePropertyChanged(nameof(PageNo)); + await LoadAsync(); + } + }); _supplierChangedToken = _eventAggregator.GetEvent() .Subscribe(async p => await OnSupplierChangedAsync(p), ThreadOption.UIThread); diff --git a/yy-admin-master/YY.Admin/Views/Supplier/SupplierListView.xaml b/yy-admin-master/YY.Admin/Views/Supplier/SupplierListView.xaml index bf32544..8d55638 100644 --- a/yy-admin-master/YY.Admin/Views/Supplier/SupplierListView.xaml +++ b/yy-admin-master/YY.Admin/Views/Supplier/SupplierListView.xaml @@ -9,33 +9,115 @@ prism:ViewModelLocator.AutoWireViewModel="True" mc:Ignorable="d"> - + + + + + + - - - - - + + + + + + + + + + + + + - - - + + + - + + + + + + - - - - - - + + + + + + @@ -79,5 +161,15 @@ + + + + + - @@ -114,36 +108,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -