diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs index 9b6fb3d..02a28a8 100644 --- a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class GoodsQueryPageViewModel + public class GoodsQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public GoodsQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs index 9b6fb3d..02a28a8 100644 --- a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class GoodsQueryPageViewModel + public class GoodsQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public GoodsQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index 85d3e15..b62cb3c 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -24,7 +24,7 @@ new FunctionModel("/Images/指定耗材查询.png", "指定耗材查询"), new FunctionModel("/Images/消耗查询.png", "消耗查询"), new FunctionModel("/Images/监控查询.png", "监控查询"), - new FunctionModel("/Images/综合查询.png", "综合查询") + new FunctionModel("/Images/综合查询.png", "在途统计") }; this.InquireSelectedCommand = new RelayCommand(InquireSelected); } @@ -62,7 +62,7 @@ case "监控查询": navigationService.NavigateTo("MonitorQueryPage"); break; - case "综合查询": + case "在途统计": navigationService.NavigateTo("TotalQueryPage"); break; } diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs index 9b6fb3d..02a28a8 100644 --- a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class GoodsQueryPageViewModel + public class GoodsQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public GoodsQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index 85d3e15..b62cb3c 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -24,7 +24,7 @@ new FunctionModel("/Images/指定耗材查询.png", "指定耗材查询"), new FunctionModel("/Images/消耗查询.png", "消耗查询"), new FunctionModel("/Images/监控查询.png", "监控查询"), - new FunctionModel("/Images/综合查询.png", "综合查询") + new FunctionModel("/Images/综合查询.png", "在途统计") }; this.InquireSelectedCommand = new RelayCommand(InquireSelected); } @@ -62,7 +62,7 @@ case "监控查询": navigationService.NavigateTo("MonitorQueryPage"); break; - case "综合查询": + case "在途统计": navigationService.NavigateTo("TotalQueryPage"); break; } diff --git a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs index d3fa145..e1c3405 100644 --- a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class TotalQueryPageViewModel + public class TotalQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public TotalQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs index 9b6fb3d..02a28a8 100644 --- a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class GoodsQueryPageViewModel + public class GoodsQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public GoodsQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index 85d3e15..b62cb3c 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -24,7 +24,7 @@ new FunctionModel("/Images/指定耗材查询.png", "指定耗材查询"), new FunctionModel("/Images/消耗查询.png", "消耗查询"), new FunctionModel("/Images/监控查询.png", "监控查询"), - new FunctionModel("/Images/综合查询.png", "综合查询") + new FunctionModel("/Images/综合查询.png", "在途统计") }; this.InquireSelectedCommand = new RelayCommand(InquireSelected); } @@ -62,7 +62,7 @@ case "监控查询": navigationService.NavigateTo("MonitorQueryPage"); break; - case "综合查询": + case "在途统计": navigationService.NavigateTo("TotalQueryPage"); break; } diff --git a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs index d3fa145..e1c3405 100644 --- a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class TotalQueryPageViewModel + public class TotalQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public TotalQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index f772a99..8ccd680 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -33,36 +33,44 @@ { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); - // ע��ҳ��VM - SimpleIoc.Default.Register(); //��¼ҳ - SimpleIoc.Default.Register(); //������ - SimpleIoc.Default.Register(); //����������Pageҳ - SimpleIoc.Default.Register(); //�黹Pageҳ - SimpleIoc.Default.Register(); //��������Pageҳ - SimpleIoc.Default.Register(); //�ϼ�Pageҳ - SimpleIoc.Default.Register(); //�̵�Pageҳ - SimpleIoc.Default.Register(); //��SPD��Pageҳ - SimpleIoc.Default.Register(); //��ѯPageҳ - SimpleIoc.Default.Register(); //������Pageҳ - SimpleIoc.Default.Register(); //����Pageҳ - SimpleIoc.Default.Register(); //������ƷPageҳ - SimpleIoc.Default.Register(); //����û�Dialog + // VM + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); - // ע�ᵼ��Service + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + var navigationService = this.InitNavigationService(); SimpleIoc.Default.Register(() => navigationService); } /// - /// ����NavigationService���� + /// NavigationService /// /// NavigationService private INavigationService InitNavigationService() { var service = new NavigationService(); - // ���ѡ�� + // service.Configure("MainWindow", new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", @@ -84,13 +92,11 @@ service.Configure("CabinetMainPage", new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); - // �ײ�ѡ�� service.Configure("SettingsPage", new Uri("/SubCabinetSolution;component/Views/SettingsPage.xaml", UriKind.Relative)); service.Configure("RecentUsePage", new Uri("/SubCabinetSolution;component/Views/RecentUsePage.xaml", UriKind.Relative)); - - // InquirePage�ֹ��� + service.Configure("InventoryQueryPage", new Uri("/SubCabinetSolution;component/Views/InventoryQueryPage.xaml", UriKind.Relative)); service.Configure("NotReturnedQueryPage", @@ -110,7 +116,6 @@ return service; } - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); @@ -130,27 +135,32 @@ ServiceLocator.Current.GetInstance(); public SettingsPageViewModel SettingsPage => ServiceLocator.Current.GetInstance(); - + public RecentUsePageViewModel RecentUsePage => ServiceLocator.Current.GetInstance(); - + public AddUserDialogViewModel AddUserDialog => ServiceLocator.Current.GetInstance(); - - public InventoryQueryPageViewModel InventoryQueryPage => ServiceLocator.Current.GetInstance(); - - public NotReturnedQueryPageViewModel NotReturnedQueryPage => ServiceLocator.Current.GetInstance(); - - public PutCabinetQueryPageViewModel PutCabinetQueryPage => ServiceLocator.Current.GetInstance(); - + + public InventoryQueryPageViewModel InventoryQueryPage => + ServiceLocator.Current.GetInstance(); + + public NotReturnedQueryPageViewModel NotReturnedQueryPage => + ServiceLocator.Current.GetInstance(); + + public PutCabinetQueryPageViewModel PutCabinetQueryPage => + ServiceLocator.Current.GetInstance(); + public SpdQueryPageViewModel SpdQueryPage => ServiceLocator.Current.GetInstance(); - + public GoodsQueryPageViewModel GoodsQueryPage => ServiceLocator.Current.GetInstance(); - - public ConsumeQueryPageViewModel ConsumeQueryPage => ServiceLocator.Current.GetInstance(); - - public MonitorQueryPageViewModel MonitorQueryPage => ServiceLocator.Current.GetInstance(); - + + public ConsumeQueryPageViewModel ConsumeQueryPage => + ServiceLocator.Current.GetInstance(); + + public MonitorQueryPageViewModel MonitorQueryPage => + ServiceLocator.Current.GetInstance(); + public TotalQueryPageViewModel TotalQueryPage => ServiceLocator.Current.GetInstance(); - + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs index 9b6fb3d..02a28a8 100644 --- a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class GoodsQueryPageViewModel + public class GoodsQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public GoodsQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index 85d3e15..b62cb3c 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -24,7 +24,7 @@ new FunctionModel("/Images/指定耗材查询.png", "指定耗材查询"), new FunctionModel("/Images/消耗查询.png", "消耗查询"), new FunctionModel("/Images/监控查询.png", "监控查询"), - new FunctionModel("/Images/综合查询.png", "综合查询") + new FunctionModel("/Images/综合查询.png", "在途统计") }; this.InquireSelectedCommand = new RelayCommand(InquireSelected); } @@ -62,7 +62,7 @@ case "监控查询": navigationService.NavigateTo("MonitorQueryPage"); break; - case "综合查询": + case "在途统计": navigationService.NavigateTo("TotalQueryPage"); break; } diff --git a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs index d3fa145..e1c3405 100644 --- a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class TotalQueryPageViewModel + public class TotalQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public TotalQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index f772a99..8ccd680 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -33,36 +33,44 @@ { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); - // ע��ҳ��VM - SimpleIoc.Default.Register(); //��¼ҳ - SimpleIoc.Default.Register(); //������ - SimpleIoc.Default.Register(); //����������Pageҳ - SimpleIoc.Default.Register(); //�黹Pageҳ - SimpleIoc.Default.Register(); //��������Pageҳ - SimpleIoc.Default.Register(); //�ϼ�Pageҳ - SimpleIoc.Default.Register(); //�̵�Pageҳ - SimpleIoc.Default.Register(); //��SPD��Pageҳ - SimpleIoc.Default.Register(); //��ѯPageҳ - SimpleIoc.Default.Register(); //������Pageҳ - SimpleIoc.Default.Register(); //����Pageҳ - SimpleIoc.Default.Register(); //������ƷPageҳ - SimpleIoc.Default.Register(); //����û�Dialog + // VM + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); - // ע�ᵼ��Service + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + var navigationService = this.InitNavigationService(); SimpleIoc.Default.Register(() => navigationService); } /// - /// ����NavigationService���� + /// NavigationService /// /// NavigationService private INavigationService InitNavigationService() { var service = new NavigationService(); - // ���ѡ�� + // service.Configure("MainWindow", new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", @@ -84,13 +92,11 @@ service.Configure("CabinetMainPage", new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); - // �ײ�ѡ�� service.Configure("SettingsPage", new Uri("/SubCabinetSolution;component/Views/SettingsPage.xaml", UriKind.Relative)); service.Configure("RecentUsePage", new Uri("/SubCabinetSolution;component/Views/RecentUsePage.xaml", UriKind.Relative)); - - // InquirePage�ֹ��� + service.Configure("InventoryQueryPage", new Uri("/SubCabinetSolution;component/Views/InventoryQueryPage.xaml", UriKind.Relative)); service.Configure("NotReturnedQueryPage", @@ -110,7 +116,6 @@ return service; } - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); @@ -130,27 +135,32 @@ ServiceLocator.Current.GetInstance(); public SettingsPageViewModel SettingsPage => ServiceLocator.Current.GetInstance(); - + public RecentUsePageViewModel RecentUsePage => ServiceLocator.Current.GetInstance(); - + public AddUserDialogViewModel AddUserDialog => ServiceLocator.Current.GetInstance(); - - public InventoryQueryPageViewModel InventoryQueryPage => ServiceLocator.Current.GetInstance(); - - public NotReturnedQueryPageViewModel NotReturnedQueryPage => ServiceLocator.Current.GetInstance(); - - public PutCabinetQueryPageViewModel PutCabinetQueryPage => ServiceLocator.Current.GetInstance(); - + + public InventoryQueryPageViewModel InventoryQueryPage => + ServiceLocator.Current.GetInstance(); + + public NotReturnedQueryPageViewModel NotReturnedQueryPage => + ServiceLocator.Current.GetInstance(); + + public PutCabinetQueryPageViewModel PutCabinetQueryPage => + ServiceLocator.Current.GetInstance(); + public SpdQueryPageViewModel SpdQueryPage => ServiceLocator.Current.GetInstance(); - + public GoodsQueryPageViewModel GoodsQueryPage => ServiceLocator.Current.GetInstance(); - - public ConsumeQueryPageViewModel ConsumeQueryPage => ServiceLocator.Current.GetInstance(); - - public MonitorQueryPageViewModel MonitorQueryPage => ServiceLocator.Current.GetInstance(); - + + public ConsumeQueryPageViewModel ConsumeQueryPage => + ServiceLocator.Current.GetInstance(); + + public MonitorQueryPageViewModel MonitorQueryPage => + ServiceLocator.Current.GetInstance(); + public TotalQueryPageViewModel TotalQueryPage => ServiceLocator.Current.GetInstance(); - + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml index 978c121..79f54f8 100644 --- a/SubCabinetSolution/Views/CabinetMainPage.xaml +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -7,9 +7,274 @@ Title="CabinetMainPage" d:DesignHeight="450" d:DesignWidth="800" + Background="White" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs index 9b6fb3d..02a28a8 100644 --- a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class GoodsQueryPageViewModel + public class GoodsQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public GoodsQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index 85d3e15..b62cb3c 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -24,7 +24,7 @@ new FunctionModel("/Images/指定耗材查询.png", "指定耗材查询"), new FunctionModel("/Images/消耗查询.png", "消耗查询"), new FunctionModel("/Images/监控查询.png", "监控查询"), - new FunctionModel("/Images/综合查询.png", "综合查询") + new FunctionModel("/Images/综合查询.png", "在途统计") }; this.InquireSelectedCommand = new RelayCommand(InquireSelected); } @@ -62,7 +62,7 @@ case "监控查询": navigationService.NavigateTo("MonitorQueryPage"); break; - case "综合查询": + case "在途统计": navigationService.NavigateTo("TotalQueryPage"); break; } diff --git a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs index d3fa145..e1c3405 100644 --- a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class TotalQueryPageViewModel + public class TotalQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public TotalQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index f772a99..8ccd680 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -33,36 +33,44 @@ { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); - // ע��ҳ��VM - SimpleIoc.Default.Register(); //��¼ҳ - SimpleIoc.Default.Register(); //������ - SimpleIoc.Default.Register(); //����������Pageҳ - SimpleIoc.Default.Register(); //�黹Pageҳ - SimpleIoc.Default.Register(); //��������Pageҳ - SimpleIoc.Default.Register(); //�ϼ�Pageҳ - SimpleIoc.Default.Register(); //�̵�Pageҳ - SimpleIoc.Default.Register(); //��SPD��Pageҳ - SimpleIoc.Default.Register(); //��ѯPageҳ - SimpleIoc.Default.Register(); //������Pageҳ - SimpleIoc.Default.Register(); //����Pageҳ - SimpleIoc.Default.Register(); //������ƷPageҳ - SimpleIoc.Default.Register(); //����û�Dialog + // VM + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); - // ע�ᵼ��Service + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + var navigationService = this.InitNavigationService(); SimpleIoc.Default.Register(() => navigationService); } /// - /// ����NavigationService���� + /// NavigationService /// /// NavigationService private INavigationService InitNavigationService() { var service = new NavigationService(); - // ���ѡ�� + // service.Configure("MainWindow", new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", @@ -84,13 +92,11 @@ service.Configure("CabinetMainPage", new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); - // �ײ�ѡ�� service.Configure("SettingsPage", new Uri("/SubCabinetSolution;component/Views/SettingsPage.xaml", UriKind.Relative)); service.Configure("RecentUsePage", new Uri("/SubCabinetSolution;component/Views/RecentUsePage.xaml", UriKind.Relative)); - - // InquirePage�ֹ��� + service.Configure("InventoryQueryPage", new Uri("/SubCabinetSolution;component/Views/InventoryQueryPage.xaml", UriKind.Relative)); service.Configure("NotReturnedQueryPage", @@ -110,7 +116,6 @@ return service; } - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); @@ -130,27 +135,32 @@ ServiceLocator.Current.GetInstance(); public SettingsPageViewModel SettingsPage => ServiceLocator.Current.GetInstance(); - + public RecentUsePageViewModel RecentUsePage => ServiceLocator.Current.GetInstance(); - + public AddUserDialogViewModel AddUserDialog => ServiceLocator.Current.GetInstance(); - - public InventoryQueryPageViewModel InventoryQueryPage => ServiceLocator.Current.GetInstance(); - - public NotReturnedQueryPageViewModel NotReturnedQueryPage => ServiceLocator.Current.GetInstance(); - - public PutCabinetQueryPageViewModel PutCabinetQueryPage => ServiceLocator.Current.GetInstance(); - + + public InventoryQueryPageViewModel InventoryQueryPage => + ServiceLocator.Current.GetInstance(); + + public NotReturnedQueryPageViewModel NotReturnedQueryPage => + ServiceLocator.Current.GetInstance(); + + public PutCabinetQueryPageViewModel PutCabinetQueryPage => + ServiceLocator.Current.GetInstance(); + public SpdQueryPageViewModel SpdQueryPage => ServiceLocator.Current.GetInstance(); - + public GoodsQueryPageViewModel GoodsQueryPage => ServiceLocator.Current.GetInstance(); - - public ConsumeQueryPageViewModel ConsumeQueryPage => ServiceLocator.Current.GetInstance(); - - public MonitorQueryPageViewModel MonitorQueryPage => ServiceLocator.Current.GetInstance(); - + + public ConsumeQueryPageViewModel ConsumeQueryPage => + ServiceLocator.Current.GetInstance(); + + public MonitorQueryPageViewModel MonitorQueryPage => + ServiceLocator.Current.GetInstance(); + public TotalQueryPageViewModel TotalQueryPage => ServiceLocator.Current.GetInstance(); - + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml index 978c121..79f54f8 100644 --- a/SubCabinetSolution/Views/CabinetMainPage.xaml +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -7,9 +7,274 @@ Title="CabinetMainPage" d:DesignHeight="450" d:DesignWidth="800" + Background="White" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetWindow.xaml b/SubCabinetSolution/Views/CabinetWindow.xaml index 69d594e..18e4a3a 100644 --- a/SubCabinetSolution/Views/CabinetWindow.xaml +++ b/SubCabinetSolution/Views/CabinetWindow.xaml @@ -175,7 +175,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs index 9b6fb3d..02a28a8 100644 --- a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class GoodsQueryPageViewModel + public class GoodsQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public GoodsQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index 85d3e15..b62cb3c 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -24,7 +24,7 @@ new FunctionModel("/Images/指定耗材查询.png", "指定耗材查询"), new FunctionModel("/Images/消耗查询.png", "消耗查询"), new FunctionModel("/Images/监控查询.png", "监控查询"), - new FunctionModel("/Images/综合查询.png", "综合查询") + new FunctionModel("/Images/综合查询.png", "在途统计") }; this.InquireSelectedCommand = new RelayCommand(InquireSelected); } @@ -62,7 +62,7 @@ case "监控查询": navigationService.NavigateTo("MonitorQueryPage"); break; - case "综合查询": + case "在途统计": navigationService.NavigateTo("TotalQueryPage"); break; } diff --git a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs index d3fa145..e1c3405 100644 --- a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class TotalQueryPageViewModel + public class TotalQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public TotalQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index f772a99..8ccd680 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -33,36 +33,44 @@ { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); - // ע��ҳ��VM - SimpleIoc.Default.Register(); //��¼ҳ - SimpleIoc.Default.Register(); //������ - SimpleIoc.Default.Register(); //����������Pageҳ - SimpleIoc.Default.Register(); //�黹Pageҳ - SimpleIoc.Default.Register(); //��������Pageҳ - SimpleIoc.Default.Register(); //�ϼ�Pageҳ - SimpleIoc.Default.Register(); //�̵�Pageҳ - SimpleIoc.Default.Register(); //��SPD��Pageҳ - SimpleIoc.Default.Register(); //��ѯPageҳ - SimpleIoc.Default.Register(); //������Pageҳ - SimpleIoc.Default.Register(); //����Pageҳ - SimpleIoc.Default.Register(); //������ƷPageҳ - SimpleIoc.Default.Register(); //����û�Dialog + // VM + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); - // ע�ᵼ��Service + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + var navigationService = this.InitNavigationService(); SimpleIoc.Default.Register(() => navigationService); } /// - /// ����NavigationService���� + /// NavigationService /// /// NavigationService private INavigationService InitNavigationService() { var service = new NavigationService(); - // ���ѡ�� + // service.Configure("MainWindow", new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", @@ -84,13 +92,11 @@ service.Configure("CabinetMainPage", new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); - // �ײ�ѡ�� service.Configure("SettingsPage", new Uri("/SubCabinetSolution;component/Views/SettingsPage.xaml", UriKind.Relative)); service.Configure("RecentUsePage", new Uri("/SubCabinetSolution;component/Views/RecentUsePage.xaml", UriKind.Relative)); - - // InquirePage�ֹ��� + service.Configure("InventoryQueryPage", new Uri("/SubCabinetSolution;component/Views/InventoryQueryPage.xaml", UriKind.Relative)); service.Configure("NotReturnedQueryPage", @@ -110,7 +116,6 @@ return service; } - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); @@ -130,27 +135,32 @@ ServiceLocator.Current.GetInstance(); public SettingsPageViewModel SettingsPage => ServiceLocator.Current.GetInstance(); - + public RecentUsePageViewModel RecentUsePage => ServiceLocator.Current.GetInstance(); - + public AddUserDialogViewModel AddUserDialog => ServiceLocator.Current.GetInstance(); - - public InventoryQueryPageViewModel InventoryQueryPage => ServiceLocator.Current.GetInstance(); - - public NotReturnedQueryPageViewModel NotReturnedQueryPage => ServiceLocator.Current.GetInstance(); - - public PutCabinetQueryPageViewModel PutCabinetQueryPage => ServiceLocator.Current.GetInstance(); - + + public InventoryQueryPageViewModel InventoryQueryPage => + ServiceLocator.Current.GetInstance(); + + public NotReturnedQueryPageViewModel NotReturnedQueryPage => + ServiceLocator.Current.GetInstance(); + + public PutCabinetQueryPageViewModel PutCabinetQueryPage => + ServiceLocator.Current.GetInstance(); + public SpdQueryPageViewModel SpdQueryPage => ServiceLocator.Current.GetInstance(); - + public GoodsQueryPageViewModel GoodsQueryPage => ServiceLocator.Current.GetInstance(); - - public ConsumeQueryPageViewModel ConsumeQueryPage => ServiceLocator.Current.GetInstance(); - - public MonitorQueryPageViewModel MonitorQueryPage => ServiceLocator.Current.GetInstance(); - + + public ConsumeQueryPageViewModel ConsumeQueryPage => + ServiceLocator.Current.GetInstance(); + + public MonitorQueryPageViewModel MonitorQueryPage => + ServiceLocator.Current.GetInstance(); + public TotalQueryPageViewModel TotalQueryPage => ServiceLocator.Current.GetInstance(); - + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml index 978c121..79f54f8 100644 --- a/SubCabinetSolution/Views/CabinetMainPage.xaml +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -7,9 +7,274 @@ Title="CabinetMainPage" d:DesignHeight="450" d:DesignWidth="800" + Background="White" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetWindow.xaml b/SubCabinetSolution/Views/CabinetWindow.xaml index 69d594e..18e4a3a 100644 --- a/SubCabinetSolution/Views/CabinetWindow.xaml +++ b/SubCabinetSolution/Views/CabinetWindow.xaml @@ -175,7 +175,6 @@ + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs index 9b6fb3d..02a28a8 100644 --- a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class GoodsQueryPageViewModel + public class GoodsQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public GoodsQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index 85d3e15..b62cb3c 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -24,7 +24,7 @@ new FunctionModel("/Images/指定耗材查询.png", "指定耗材查询"), new FunctionModel("/Images/消耗查询.png", "消耗查询"), new FunctionModel("/Images/监控查询.png", "监控查询"), - new FunctionModel("/Images/综合查询.png", "综合查询") + new FunctionModel("/Images/综合查询.png", "在途统计") }; this.InquireSelectedCommand = new RelayCommand(InquireSelected); } @@ -62,7 +62,7 @@ case "监控查询": navigationService.NavigateTo("MonitorQueryPage"); break; - case "综合查询": + case "在途统计": navigationService.NavigateTo("TotalQueryPage"); break; } diff --git a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs index d3fa145..e1c3405 100644 --- a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class TotalQueryPageViewModel + public class TotalQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public TotalQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index f772a99..8ccd680 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -33,36 +33,44 @@ { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); - // ע��ҳ��VM - SimpleIoc.Default.Register(); //��¼ҳ - SimpleIoc.Default.Register(); //������ - SimpleIoc.Default.Register(); //����������Pageҳ - SimpleIoc.Default.Register(); //�黹Pageҳ - SimpleIoc.Default.Register(); //��������Pageҳ - SimpleIoc.Default.Register(); //�ϼ�Pageҳ - SimpleIoc.Default.Register(); //�̵�Pageҳ - SimpleIoc.Default.Register(); //��SPD��Pageҳ - SimpleIoc.Default.Register(); //��ѯPageҳ - SimpleIoc.Default.Register(); //������Pageҳ - SimpleIoc.Default.Register(); //����Pageҳ - SimpleIoc.Default.Register(); //������ƷPageҳ - SimpleIoc.Default.Register(); //����û�Dialog + // VM + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); - // ע�ᵼ��Service + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + var navigationService = this.InitNavigationService(); SimpleIoc.Default.Register(() => navigationService); } /// - /// ����NavigationService���� + /// NavigationService /// /// NavigationService private INavigationService InitNavigationService() { var service = new NavigationService(); - // ���ѡ�� + // service.Configure("MainWindow", new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", @@ -84,13 +92,11 @@ service.Configure("CabinetMainPage", new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); - // �ײ�ѡ�� service.Configure("SettingsPage", new Uri("/SubCabinetSolution;component/Views/SettingsPage.xaml", UriKind.Relative)); service.Configure("RecentUsePage", new Uri("/SubCabinetSolution;component/Views/RecentUsePage.xaml", UriKind.Relative)); - - // InquirePage�ֹ��� + service.Configure("InventoryQueryPage", new Uri("/SubCabinetSolution;component/Views/InventoryQueryPage.xaml", UriKind.Relative)); service.Configure("NotReturnedQueryPage", @@ -110,7 +116,6 @@ return service; } - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); @@ -130,27 +135,32 @@ ServiceLocator.Current.GetInstance(); public SettingsPageViewModel SettingsPage => ServiceLocator.Current.GetInstance(); - + public RecentUsePageViewModel RecentUsePage => ServiceLocator.Current.GetInstance(); - + public AddUserDialogViewModel AddUserDialog => ServiceLocator.Current.GetInstance(); - - public InventoryQueryPageViewModel InventoryQueryPage => ServiceLocator.Current.GetInstance(); - - public NotReturnedQueryPageViewModel NotReturnedQueryPage => ServiceLocator.Current.GetInstance(); - - public PutCabinetQueryPageViewModel PutCabinetQueryPage => ServiceLocator.Current.GetInstance(); - + + public InventoryQueryPageViewModel InventoryQueryPage => + ServiceLocator.Current.GetInstance(); + + public NotReturnedQueryPageViewModel NotReturnedQueryPage => + ServiceLocator.Current.GetInstance(); + + public PutCabinetQueryPageViewModel PutCabinetQueryPage => + ServiceLocator.Current.GetInstance(); + public SpdQueryPageViewModel SpdQueryPage => ServiceLocator.Current.GetInstance(); - + public GoodsQueryPageViewModel GoodsQueryPage => ServiceLocator.Current.GetInstance(); - - public ConsumeQueryPageViewModel ConsumeQueryPage => ServiceLocator.Current.GetInstance(); - - public MonitorQueryPageViewModel MonitorQueryPage => ServiceLocator.Current.GetInstance(); - + + public ConsumeQueryPageViewModel ConsumeQueryPage => + ServiceLocator.Current.GetInstance(); + + public MonitorQueryPageViewModel MonitorQueryPage => + ServiceLocator.Current.GetInstance(); + public TotalQueryPageViewModel TotalQueryPage => ServiceLocator.Current.GetInstance(); - + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml index 978c121..79f54f8 100644 --- a/SubCabinetSolution/Views/CabinetMainPage.xaml +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -7,9 +7,274 @@ Title="CabinetMainPage" d:DesignHeight="450" d:DesignWidth="800" + Background="White" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetWindow.xaml b/SubCabinetSolution/Views/CabinetWindow.xaml index 69d594e..18e4a3a 100644 --- a/SubCabinetSolution/Views/CabinetWindow.xaml +++ b/SubCabinetSolution/Views/CabinetWindow.xaml @@ -175,7 +175,6 @@ + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/SubCabinetSolution/Views/GoodsQueryPage.xaml b/SubCabinetSolution/Views/GoodsQueryPage.xaml index ff3c571..6ff5eae 100644 --- a/SubCabinetSolution/Views/GoodsQueryPage.xaml +++ b/SubCabinetSolution/Views/GoodsQueryPage.xaml @@ -1,12 +1,238 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml index 56cd6ed..c476474 100644 --- a/.idea/.idea.SubCabinetSolution/.idea/encodings.xml +++ b/.idea/.idea.SubCabinetSolution/.idea/encodings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.vs/SubCabinetSolution/v17/.suo b/.vs/SubCabinetSolution/v17/.suo index 33a1957..c9b3509 100644 --- a/.vs/SubCabinetSolution/v17/.suo +++ b/.vs/SubCabinetSolution/v17/.suo Binary files differ diff --git a/SubCabinetSolution/Utils/NavigationService.cs b/SubCabinetSolution/Utils/NavigationService.cs index 935a7fa..1e00f07 100644 --- a/SubCabinetSolution/Utils/NavigationService.cs +++ b/SubCabinetSolution/Utils/NavigationService.cs @@ -56,11 +56,11 @@ { if (!_pagesByKey.ContainsKey(pageKey)) { - throw new ArgumentException($"No such page: {pageKey} ", nameof(pageKey)); + throw new ArgumentException($@"No such page: {pageKey} ", nameof(pageKey)); } // 设置应用主窗口,name要注意和xaml保持一致 - CabinetWindow cabinetWindow = Application.Current.Windows + var cabinetWindow = Application.Current.Windows .Cast() .FirstOrDefault(window => window is CabinetWindow) as CabinetWindow; if (GetDescendantFromName(cabinetWindow, "CabinetFunctionFrame") is Frame frame) diff --git a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs index a64c933..84cddf8 100644 --- a/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/CabinetMainPageViewModel.cs @@ -1,7 +1,45 @@ -namespace SubCabinetSolution.ViewModel +using System.Collections.ObjectModel; +using GalaSoft.MvvmLight; +using SubCabinetSolution.Model; + +namespace SubCabinetSolution.ViewModel { - public class CabinetMainPageViewModel + public class CabinetMainPageViewModel : ViewModelBase { - + public ObservableCollection FirstDoorGoods { get; set; } + public ObservableCollection SecondDoorGoods { get; set; } + public ObservableCollection ThirdDoorGoods { get; set; } + public ObservableCollection FourthDoorGoods { get; set; } + public ObservableCollection FifthDoorGoods { get; set; } + public ObservableCollection SixthDoorGoods { get; set; } + + public CabinetMainPageViewModel() + { + this.FirstDoorGoods = new ObservableCollection + { + new GoodsModel("止血纱布", "[19]"), + new GoodsModel("可吸收医用膜", "[89]"), + new GoodsModel("消融电极", "[59]"), + new GoodsModel("疝环充填补片", "[19]"), + new GoodsModel("微创扩展引流套", "[29]"), + new GoodsModel("创口贴", "[69]"), + new GoodsModel("一次性医用口罩", "[2]") + }; + this.SecondDoorGoods = new ObservableCollection + { + }; + this.ThirdDoorGoods = new ObservableCollection + { + }; + this.FourthDoorGoods = new ObservableCollection + { + }; + this.FifthDoorGoods = new ObservableCollection + { + }; + this.SixthDoorGoods = new ObservableCollection + { + }; + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs index 1a9353b..c619e0c 100644 --- a/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/ConsumeQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class ConsumeQueryPageViewModel + public class ConsumeQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public ConsumeQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs index 9b6fb3d..02a28a8 100644 --- a/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/GoodsQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class GoodsQueryPageViewModel + public class GoodsQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public GoodsQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs index 85d3e15..b62cb3c 100644 --- a/SubCabinetSolution/ViewModel/InquirePageViewModel.cs +++ b/SubCabinetSolution/ViewModel/InquirePageViewModel.cs @@ -24,7 +24,7 @@ new FunctionModel("/Images/指定耗材查询.png", "指定耗材查询"), new FunctionModel("/Images/消耗查询.png", "消耗查询"), new FunctionModel("/Images/监控查询.png", "监控查询"), - new FunctionModel("/Images/综合查询.png", "综合查询") + new FunctionModel("/Images/综合查询.png", "在途统计") }; this.InquireSelectedCommand = new RelayCommand(InquireSelected); } @@ -62,7 +62,7 @@ case "监控查询": navigationService.NavigateTo("MonitorQueryPage"); break; - case "综合查询": + case "在途统计": navigationService.NavigateTo("TotalQueryPage"); break; } diff --git a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs index d3fa145..e1c3405 100644 --- a/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs +++ b/SubCabinetSolution/ViewModel/TotalQueryPageViewModel.cs @@ -1,7 +1,22 @@ -namespace SubCabinetSolution.ViewModel +using CommonServiceLocator; +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; +using GalaSoft.MvvmLight.Views; + +namespace SubCabinetSolution.ViewModel { - public class TotalQueryPageViewModel + public class TotalQueryPageViewModel : ViewModelBase { - + public RelayCommand GoBackCommand { get; set; } + + public TotalQueryPageViewModel() + { + this.GoBackCommand = new RelayCommand(GoBack); + } + + private void GoBack() + { + ServiceLocator.Current.GetInstance().GoBack(); + } } } \ No newline at end of file diff --git a/SubCabinetSolution/ViewModel/ViewModelLocator.cs b/SubCabinetSolution/ViewModel/ViewModelLocator.cs index f772a99..8ccd680 100644 --- a/SubCabinetSolution/ViewModel/ViewModelLocator.cs +++ b/SubCabinetSolution/ViewModel/ViewModelLocator.cs @@ -33,36 +33,44 @@ { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); - // ע��ҳ��VM - SimpleIoc.Default.Register(); //��¼ҳ - SimpleIoc.Default.Register(); //������ - SimpleIoc.Default.Register(); //����������Pageҳ - SimpleIoc.Default.Register(); //�黹Pageҳ - SimpleIoc.Default.Register(); //��������Pageҳ - SimpleIoc.Default.Register(); //�ϼ�Pageҳ - SimpleIoc.Default.Register(); //�̵�Pageҳ - SimpleIoc.Default.Register(); //��SPD��Pageҳ - SimpleIoc.Default.Register(); //��ѯPageҳ - SimpleIoc.Default.Register(); //������Pageҳ - SimpleIoc.Default.Register(); //����Pageҳ - SimpleIoc.Default.Register(); //������ƷPageҳ - SimpleIoc.Default.Register(); //����û�Dialog + // VM + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); - // ע�ᵼ��Service + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + var navigationService = this.InitNavigationService(); SimpleIoc.Default.Register(() => navigationService); } /// - /// ����NavigationService���� + /// NavigationService /// /// NavigationService private INavigationService InitNavigationService() { var service = new NavigationService(); - // ���ѡ�� + // service.Configure("MainWindow", new Uri("/SubCabinetSolution;component/Views/MainWindow.xaml", UriKind.Relative)); service.Configure("CabinetWindow", @@ -84,13 +92,11 @@ service.Configure("CabinetMainPage", new Uri("/SubCabinetSolution;component/Views/CabinetMainPage.xaml", UriKind.Relative)); - // �ײ�ѡ�� service.Configure("SettingsPage", new Uri("/SubCabinetSolution;component/Views/SettingsPage.xaml", UriKind.Relative)); service.Configure("RecentUsePage", new Uri("/SubCabinetSolution;component/Views/RecentUsePage.xaml", UriKind.Relative)); - - // InquirePage�ֹ��� + service.Configure("InventoryQueryPage", new Uri("/SubCabinetSolution;component/Views/InventoryQueryPage.xaml", UriKind.Relative)); service.Configure("NotReturnedQueryPage", @@ -110,7 +116,6 @@ return service; } - // ÿ��VM����Ҫ���ɶ�Ӧ��ʵ������Ȼ�ᱨ��ָ�� public MainViewModel MainWindow => ServiceLocator.Current.GetInstance(); public CabinetViewModel CabinetWindow => ServiceLocator.Current.GetInstance(); @@ -130,27 +135,32 @@ ServiceLocator.Current.GetInstance(); public SettingsPageViewModel SettingsPage => ServiceLocator.Current.GetInstance(); - + public RecentUsePageViewModel RecentUsePage => ServiceLocator.Current.GetInstance(); - + public AddUserDialogViewModel AddUserDialog => ServiceLocator.Current.GetInstance(); - - public InventoryQueryPageViewModel InventoryQueryPage => ServiceLocator.Current.GetInstance(); - - public NotReturnedQueryPageViewModel NotReturnedQueryPage => ServiceLocator.Current.GetInstance(); - - public PutCabinetQueryPageViewModel PutCabinetQueryPage => ServiceLocator.Current.GetInstance(); - + + public InventoryQueryPageViewModel InventoryQueryPage => + ServiceLocator.Current.GetInstance(); + + public NotReturnedQueryPageViewModel NotReturnedQueryPage => + ServiceLocator.Current.GetInstance(); + + public PutCabinetQueryPageViewModel PutCabinetQueryPage => + ServiceLocator.Current.GetInstance(); + public SpdQueryPageViewModel SpdQueryPage => ServiceLocator.Current.GetInstance(); - + public GoodsQueryPageViewModel GoodsQueryPage => ServiceLocator.Current.GetInstance(); - - public ConsumeQueryPageViewModel ConsumeQueryPage => ServiceLocator.Current.GetInstance(); - - public MonitorQueryPageViewModel MonitorQueryPage => ServiceLocator.Current.GetInstance(); - + + public ConsumeQueryPageViewModel ConsumeQueryPage => + ServiceLocator.Current.GetInstance(); + + public MonitorQueryPageViewModel MonitorQueryPage => + ServiceLocator.Current.GetInstance(); + public TotalQueryPageViewModel TotalQueryPage => ServiceLocator.Current.GetInstance(); - + public static void Cleanup() { // TODO Clear the ViewModels diff --git a/SubCabinetSolution/Views/CabinetMainPage.xaml b/SubCabinetSolution/Views/CabinetMainPage.xaml index 978c121..79f54f8 100644 --- a/SubCabinetSolution/Views/CabinetMainPage.xaml +++ b/SubCabinetSolution/Views/CabinetMainPage.xaml @@ -7,9 +7,274 @@ Title="CabinetMainPage" d:DesignHeight="450" d:DesignWidth="800" + Background="White" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SubCabinetSolution/Views/CabinetWindow.xaml b/SubCabinetSolution/Views/CabinetWindow.xaml index 69d594e..18e4a3a 100644 --- a/SubCabinetSolution/Views/CabinetWindow.xaml +++ b/SubCabinetSolution/Views/CabinetWindow.xaml @@ -175,7 +175,6 @@ + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/SubCabinetSolution/Views/GoodsQueryPage.xaml b/SubCabinetSolution/Views/GoodsQueryPage.xaml index ff3c571..6ff5eae 100644 --- a/SubCabinetSolution/Views/GoodsQueryPage.xaml +++ b/SubCabinetSolution/Views/GoodsQueryPage.xaml @@ -1,12 +1,238 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/SubCabinetSolution/Views/TotalQueryPage.xaml b/SubCabinetSolution/Views/TotalQueryPage.xaml index 2d29a0c..37505f5 100644 --- a/SubCabinetSolution/Views/TotalQueryPage.xaml +++ b/SubCabinetSolution/Views/TotalQueryPage.xaml @@ -1,12 +1,182 @@ - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +