From 34ef64ac1a2c57f8153b236158672686edb53356 Mon Sep 17 00:00:00 2001
From: maqiao <625215135@qq.com>
Date: Mon, 6 Jan 2025 09:40:32 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=96=87?=
=?UTF-8?q?=E4=BB=B6=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
DM_Weight.Commons/DM_Weight.Commons.csproj | 13 +
.../ValidationErrorMappingBehavior.cs | 75 +
DM_Weight.sln | 51 +
DM_Weight/App.config | 129 +
DM_Weight/App.xaml | 19 +
DM_Weight/App.xaml.cs | 338 +
DM_Weight/AssemblyInfo.cs | 10 +
DM_Weight/Common/CRC16MODBUS.cs | 42 +
DM_Weight/Common/CommonClass.cs | 31 +
DM_Weight/Common/PrismManager.cs | 24 +
DM_Weight/Common/TemperatureRangeRule.cs | 61 +
.../Components/pagination/Pagination.xaml | 43 +
.../Components/pagination/Pagination.xaml.cs | 265 +
.../pagination/PaginationViewModel.cs | 81 +
DM_Weight/Converter/AddUnitConverter.cs | 31 +
DM_Weight/Converter/ApplyListConverter.cs | 91 +
DM_Weight/Converter/BoardTypeConverter.cs | 106 +
DM_Weight/Converter/BoxNumConverter.cs | 31 +
DM_Weight/Converter/DrawerSelectConverter.cs | 88 +
DM_Weight/Converter/ForeColorConverter.cs | 30 +
DM_Weight/Converter/GroupSumConverter.cs | 40 +
DM_Weight/Converter/InputQuantityConverter.cs | 26 +
.../Converter/NullableToEnabelConverter.cs | 27 +
DM_Weight/Converter/OpenBoxSelectConverter.cs | 34 +
DM_Weight/Converter/OpenStatusConverter.cs | 33 +
DM_Weight/Converter/OrderStatusConverter.cs | 38 +
DM_Weight/Converter/PaginationConverter.cs | 56 +
DM_Weight/Converter/QuantityCountConverter.cs | 25 +
DM_Weight/Converter/ShiftsStateConverter.cs | 30 +
DM_Weight/Converter/StatusConverter.cs | 97 +
DM_Weight/Converter/StockStatusConverter.cs | 50 +
DM_Weight/Converter/TotalCountConverter.cs | 35 +
DM_Weight/CustomAttribute/MessageAttribute.cs | 20 +
DM_Weight/DM_Weight.csproj | 138 +
DM_Weight/Finger/FingerprintUtil.cs | 200 +
DM_Weight/HIKVISION/CHCNetSDK.cs | 20375 ++++++++++++++++
DM_Weight/HIKVISION/CHKFunction.cs | 250 +
DM_Weight/Images/TbExit.png | Bin 0 -> 5613 bytes
DM_Weight/Images/TbJiay.png | Bin 0 -> 5521 bytes
DM_Weight/Images/TbKuc.png | Bin 0 -> 20283 bytes
DM_Weight/Images/TbQyao.png | Bin 0 -> 5774 bytes
DM_Weight/Images/TbSet.png | Bin 0 -> 5554 bytes
DM_Weight/Images/TbTuiy.png | Bin 0 -> 5708 bytes
DM_Weight/Images/body-bg.jpg | Bin 0 -> 19588 bytes
DM_Weight/Images/box-16.jpg | Bin 0 -> 18695 bytes
DM_Weight/Images/box.png | Bin 0 -> 5630 bytes
DM_Weight/Images/favicon.ico | Bin 0 -> 270398 bytes
DM_Weight/Images/finger-bg-r.png | Bin 0 -> 54076 bytes
DM_Weight/Images/logo.png | Bin 0 -> 3660 bytes
DM_Weight/Models/AccountBookG2.cs | 152 +
DM_Weight/Models/AccountType.cs | 23 +
DM_Weight/Models/BoxMenu.cs | 27 +
DM_Weight/Models/ChannelList.cs | 213 +
DM_Weight/Models/ChannelStock.cs | 223 +
DM_Weight/Models/CollectDrug.cs | 122 +
DM_Weight/Models/DestoryDetail.cs | 36 +
DM_Weight/Models/DrugBase.cs | 31 +
DM_Weight/Models/DrugInfo.cs | 105 +
DM_Weight/Models/DrugManuNo.cs | 35 +
DM_Weight/Models/DrugPleaseClaim.cs | 130 +
DM_Weight/Models/DrugPleaseManuNo.cs | 21 +
DM_Weight/Models/DrugPleaseState.cs | 20 +
DM_Weight/Models/DrugType.cs | 14 +
DM_Weight/Models/HkcChangeShifts.cs | 45 +
DM_Weight/Models/InOutInvoice.cs | 149 +
DM_Weight/Models/Invoice.cs | 20 +
DM_Weight/Models/MachineRecord.cs | 199 +
DM_Weight/Models/OrderDepartment.cs | 16 +
DM_Weight/Models/OrderDetail.cs | 151 +
DM_Weight/Models/OrderFinish.cs | 39 +
DM_Weight/Models/OrderInfo.cs | 265 +
DM_Weight/Models/PremissionDm.cs | 35 +
DM_Weight/Models/RejectionReport.cs | 102 +
DM_Weight/Models/RoleDm.cs | 40 +
DM_Weight/Models/SettingPage.cs | 56 +
DM_Weight/Models/ShiftsReport.cs | 55 +
DM_Weight/Models/SurgicalResidual.cs | 53 +
DM_Weight/Models/SurgicalSchedule.cs | 176 +
DM_Weight/Models/SurgicalScheduleDetail.cs | 68 +
DM_Weight/Models/TemperatureHumidityInfo.cs | 32 +
DM_Weight/Models/UserList.cs | 77 +
DM_Weight/Port/ModbusHelper.cs | 175 +
DM_Weight/Port/MyBaseMessage.cs | 26 +
DM_Weight/Port/MyMinaCodecFactory.cs | 19 +
DM_Weight/Port/MyMinaDecoder.cs | 62 +
DM_Weight/Port/MyMinaEncoder.cs | 61 +
DM_Weight/Port/PortUtil.cs | 1916 ++
DM_Weight/Port/ScreenUtil.cs | 171 +
DM_Weight/Port/SocketHelper.cs | 125 +
DM_Weight/Port/TemperatureHumidityJob.cs | 92 +
DM_Weight/Report/GridReportUtil.cs | 369 +
.../ReturnEmptyDistory_template.grf | 432 +
DM_Weight/ReportTemp/account_book_temp.grf | 618 +
DM_Weight/ReportTemp/changeShifts_temp.grf | 345 +
DM_Weight/ReportTemp/machine_log_add.grf | 283 +
DM_Weight/ReportTemp/machine_log_check.grf | 283 +
DM_Weight/ReportTemp/machine_log_return.grf | 283 +
DM_Weight/ReportTemp/machine_log_take.grf | 283 +
DM_Weight/ReportTemp/orderUse_template.grf | 633 +
DM_Weight/ReportTemp/stock_template.grf | 346 +
DM_Weight/ReportTemp/use_jiaojie.grf | 558 +
.../Validation/NotEmptyValidationRule.cs | 20 +
.../ViewModels/AddNewMenuDialogViewModel.cs | 82 +
.../ViewModels/AdditionWindowViewModel.cs | 287 +
.../ViewModels/BindBoxDialogViewModel.cs | 76 +
.../BindBoxPackageWindowViewModel.cs | 506 +
.../CheckOrderNewWindowViewModel.cs | 1075 +
.../CheckSelfOrderWindowViewModel.cs | 1414 ++
.../ViewModels/DelUserDialogViewModel.cs | 45 +
.../ViewModels/DrugBaseWindowViewModel.cs | 12 +
.../ViewModels/EditUserDialogViewModel.cs | 253 +
.../ViewModels/FingerprintDialogViewModel.cs | 133 +
DM_Weight/ViewModels/HomeWindowViewModel.cs | 666 +
DM_Weight/ViewModels/LoginWindowViewModel.cs | 492 +
.../MachineRecordWindowViewModel.cs | 144 +
DM_Weight/ViewModels/MainWindowViewModel.cs | 146 +
.../ViewModels/OpenBoxNewWindowViewModel.cs | 554 +
.../ViewModels/OpenBoxWindowViewModel.cs | 264 +
.../ViewModels/RoleManagerWindowViewModel.cs | 897 +
.../ViewModels/SetMenuWindowViewModel.cs | 69 +
.../ViewModels/SettingBoxWindowViewModel.cs | 378 +
.../ViewModels/SettingMainWindowViewModel.cs | 82 +
.../ViewModels/SettingWindowViewModel.cs | 89 +
.../ViewModels/ShowMessageDialogViewModel.cs | 54 +
.../ViewModels/UserManagerWindowViewModel.cs | 239 +
.../ViewModels/WSDRecordWindowViewModel.cs | 146 +
DM_Weight/Views/AdditionWindow.xaml | 169 +
DM_Weight/Views/AdditionWindow.xaml.cs | 53 +
DM_Weight/Views/BindBoxPackageWindow.xaml | 233 +
DM_Weight/Views/BindBoxPackageWindow.xaml.cs | 49 +
DM_Weight/Views/CheckOrderNewWindow.xaml | 302 +
DM_Weight/Views/CheckOrderNewWindow.xaml.cs | 28 +
DM_Weight/Views/CheckSelfOrderWindow.xaml | 302 +
DM_Weight/Views/CheckSelfOrderWindow.xaml.cs | 28 +
DM_Weight/Views/Dialog/AddNewMenuDialog.xaml | 117 +
.../Views/Dialog/AddNewMenuDialog.xaml.cs | 47 +
DM_Weight/Views/Dialog/AddSurgeryDialog.xaml | 329 +
.../Views/Dialog/AddSurgeryDialog.xaml.cs | 28 +
DM_Weight/Views/Dialog/BindBoxDialog.xaml | 130 +
DM_Weight/Views/Dialog/BindBoxDialog.xaml.cs | 47 +
DM_Weight/Views/Dialog/DelUserDialog.xaml | 42 +
DM_Weight/Views/Dialog/DelUserDialog.xaml.cs | 28 +
DM_Weight/Views/Dialog/EditUserDialog.xaml | 106 +
DM_Weight/Views/Dialog/EditUserDialog.xaml.cs | 28 +
DM_Weight/Views/Dialog/FingerprintDialog.xaml | 59 +
.../Views/Dialog/FingerprintDialog.xaml.cs | 28 +
DM_Weight/Views/Dialog/ShowMessageDialog.xaml | 23 +
.../Views/Dialog/ShowMessageDialog.xaml.cs | 28 +
DM_Weight/Views/DrugBaseWindow.xaml | 13 +
DM_Weight/Views/DrugBaseWindow.xaml.cs | 28 +
DM_Weight/Views/HomeWindow.xaml | 135 +
DM_Weight/Views/HomeWindow.xaml.cs | 70 +
DM_Weight/Views/LoginWindow.xaml | 206 +
DM_Weight/Views/LoginWindow.xaml.cs | 37 +
DM_Weight/Views/MachineRecordWindow.xaml | 103 +
DM_Weight/Views/MachineRecordWindow.xaml.cs | 28 +
DM_Weight/Views/MainWindow.xaml | 40 +
DM_Weight/Views/MainWindow.xaml.cs | 51 +
DM_Weight/Views/OpenBoxNewWindow.xaml | 97 +
DM_Weight/Views/OpenBoxNewWindow.xaml.cs | 28 +
DM_Weight/Views/OpenBoxWindow.xaml | 64 +
DM_Weight/Views/OpenBoxWindow.xaml.cs | 28 +
DM_Weight/Views/OrderTakeDrugNewWindow.xaml | 152 +
.../Views/OrderTakeDrugNewWindow.xaml.cs | 28 +
DM_Weight/Views/OrderTakeDrugWindow.xaml | 134 +
DM_Weight/Views/OrderTakeDrugWindow.xaml.cs | 33 +
DM_Weight/Views/RoleManagerWindow.xaml | 196 +
DM_Weight/Views/RoleManagerWindow.xaml.cs | 28 +
DM_Weight/Views/SetMenuWindow.xaml | 108 +
DM_Weight/Views/SetMenuWindow.xaml.cs | 28 +
DM_Weight/Views/SettingBoxWindow.xaml | 146 +
DM_Weight/Views/SettingBoxWindow.xaml.cs | 28 +
DM_Weight/Views/SettingMainWindow.xaml | 44 +
DM_Weight/Views/SettingMainWindow.xaml.cs | 28 +
DM_Weight/Views/SettingWindow.xaml | 38 +
DM_Weight/Views/SettingWindow.xaml.cs | 28 +
DM_Weight/Views/UserManagerWindow.xaml | 131 +
DM_Weight/Views/UserManagerWindow.xaml.cs | 28 +
DM_Weight/Views/WSDRecordWindow.xaml | 100 +
DM_Weight/Views/WSDRecordWindow.xaml.cs | 28 +
DM_Weight/favicon.ico | Bin 0 -> 270398 bytes
DM_Weight/log4net.config | 53 +
DM_Weight/msg/AddDrugEvent.cs | 14 +
DM_Weight/msg/BoxOpenStatusEvent.cs | 14 +
DM_Weight/msg/FingerprintEvent.cs | 14 +
DM_Weight/msg/IsSelectedEvent.cs | 14 +
DM_Weight/msg/LoginOutEvent.cs | 13 +
DM_Weight/msg/PortUtilEvent.cs | 14 +
DM_Weight/msg/SnackbarEvent.cs | 14 +
DM_Weight/select/OrderTakeSelect.cs | 14 +
DM_Weight/util/AlertMsg.cs | 19 +
DM_Weight/util/BindingProxy.cs | 18 +
DM_Weight/util/CheckComputerFreeState.cs | 70 +
DM_Weight/util/DeviceMsg.cs | 33 +
DM_Weight/util/DialogServiceExtensions.cs | 55 +
DM_Weight/util/FingerprintMsg.cs | 25 +
DM_Weight/util/GridViewExtensions.cs | 70 +
DM_Weight/util/MD5.cs | 34 +
DM_Weight/util/MaterialDialogService.cs | 159 +
DM_Weight/util/MsgType.cs | 16 +
DM_Weight/util/PromiseUtil.cs | 40 +
DM_Weight/util/ReadApp.cs | 23 +
DM_Weight/util/SqlSugarHelper.cs | 25 +
DM_Weight/util/TabTip/AnimationHelper.cs | 328 +
DM_Weight/util/TabTip/EnvironmentEx.cs | 40 +
DM_Weight/util/TabTip/HardwareKeyboard.cs | 111 +
DM_Weight/util/TabTip/PoolingTimer.cs | 26 +
DM_Weight/util/TabTip/Screen.cs | 101 +
DM_Weight/util/TabTip/TabTip.cs | 166 +
DM_Weight/util/TabTip/TabTipAutomation.cs | 121 +
DM_Weight/util/TabTip/Taskbar.cs | 132 +
DM_Weight/util/TransExpV2.cs | 41 +
DM_WeightTests/DM_WeightTests.csproj | 23 +
DM_WeightTests/Port/ScreenUtilTests.cs | 12 +
说明.txt | 2 +
215 files changed, 47258 insertions(+)
create mode 100644 DM_Weight.Commons/DM_Weight.Commons.csproj
create mode 100644 DM_Weight.Commons/ValidatRules/ValidationErrorMappingBehavior.cs
create mode 100644 DM_Weight.sln
create mode 100644 DM_Weight/App.config
create mode 100644 DM_Weight/App.xaml
create mode 100644 DM_Weight/App.xaml.cs
create mode 100644 DM_Weight/AssemblyInfo.cs
create mode 100644 DM_Weight/Common/CRC16MODBUS.cs
create mode 100644 DM_Weight/Common/CommonClass.cs
create mode 100644 DM_Weight/Common/PrismManager.cs
create mode 100644 DM_Weight/Common/TemperatureRangeRule.cs
create mode 100644 DM_Weight/Components/pagination/Pagination.xaml
create mode 100644 DM_Weight/Components/pagination/Pagination.xaml.cs
create mode 100644 DM_Weight/Components/pagination/PaginationViewModel.cs
create mode 100644 DM_Weight/Converter/AddUnitConverter.cs
create mode 100644 DM_Weight/Converter/ApplyListConverter.cs
create mode 100644 DM_Weight/Converter/BoardTypeConverter.cs
create mode 100644 DM_Weight/Converter/BoxNumConverter.cs
create mode 100644 DM_Weight/Converter/DrawerSelectConverter.cs
create mode 100644 DM_Weight/Converter/ForeColorConverter.cs
create mode 100644 DM_Weight/Converter/GroupSumConverter.cs
create mode 100644 DM_Weight/Converter/InputQuantityConverter.cs
create mode 100644 DM_Weight/Converter/NullableToEnabelConverter.cs
create mode 100644 DM_Weight/Converter/OpenBoxSelectConverter.cs
create mode 100644 DM_Weight/Converter/OpenStatusConverter.cs
create mode 100644 DM_Weight/Converter/OrderStatusConverter.cs
create mode 100644 DM_Weight/Converter/PaginationConverter.cs
create mode 100644 DM_Weight/Converter/QuantityCountConverter.cs
create mode 100644 DM_Weight/Converter/ShiftsStateConverter.cs
create mode 100644 DM_Weight/Converter/StatusConverter.cs
create mode 100644 DM_Weight/Converter/StockStatusConverter.cs
create mode 100644 DM_Weight/Converter/TotalCountConverter.cs
create mode 100644 DM_Weight/CustomAttribute/MessageAttribute.cs
create mode 100644 DM_Weight/DM_Weight.csproj
create mode 100644 DM_Weight/Finger/FingerprintUtil.cs
create mode 100644 DM_Weight/HIKVISION/CHCNetSDK.cs
create mode 100644 DM_Weight/HIKVISION/CHKFunction.cs
create mode 100644 DM_Weight/Images/TbExit.png
create mode 100644 DM_Weight/Images/TbJiay.png
create mode 100644 DM_Weight/Images/TbKuc.png
create mode 100644 DM_Weight/Images/TbQyao.png
create mode 100644 DM_Weight/Images/TbSet.png
create mode 100644 DM_Weight/Images/TbTuiy.png
create mode 100644 DM_Weight/Images/body-bg.jpg
create mode 100644 DM_Weight/Images/box-16.jpg
create mode 100644 DM_Weight/Images/box.png
create mode 100644 DM_Weight/Images/favicon.ico
create mode 100644 DM_Weight/Images/finger-bg-r.png
create mode 100644 DM_Weight/Images/logo.png
create mode 100644 DM_Weight/Models/AccountBookG2.cs
create mode 100644 DM_Weight/Models/AccountType.cs
create mode 100644 DM_Weight/Models/BoxMenu.cs
create mode 100644 DM_Weight/Models/ChannelList.cs
create mode 100644 DM_Weight/Models/ChannelStock.cs
create mode 100644 DM_Weight/Models/CollectDrug.cs
create mode 100644 DM_Weight/Models/DestoryDetail.cs
create mode 100644 DM_Weight/Models/DrugBase.cs
create mode 100644 DM_Weight/Models/DrugInfo.cs
create mode 100644 DM_Weight/Models/DrugManuNo.cs
create mode 100644 DM_Weight/Models/DrugPleaseClaim.cs
create mode 100644 DM_Weight/Models/DrugPleaseManuNo.cs
create mode 100644 DM_Weight/Models/DrugPleaseState.cs
create mode 100644 DM_Weight/Models/DrugType.cs
create mode 100644 DM_Weight/Models/HkcChangeShifts.cs
create mode 100644 DM_Weight/Models/InOutInvoice.cs
create mode 100644 DM_Weight/Models/Invoice.cs
create mode 100644 DM_Weight/Models/MachineRecord.cs
create mode 100644 DM_Weight/Models/OrderDepartment.cs
create mode 100644 DM_Weight/Models/OrderDetail.cs
create mode 100644 DM_Weight/Models/OrderFinish.cs
create mode 100644 DM_Weight/Models/OrderInfo.cs
create mode 100644 DM_Weight/Models/PremissionDm.cs
create mode 100644 DM_Weight/Models/RejectionReport.cs
create mode 100644 DM_Weight/Models/RoleDm.cs
create mode 100644 DM_Weight/Models/SettingPage.cs
create mode 100644 DM_Weight/Models/ShiftsReport.cs
create mode 100644 DM_Weight/Models/SurgicalResidual.cs
create mode 100644 DM_Weight/Models/SurgicalSchedule.cs
create mode 100644 DM_Weight/Models/SurgicalScheduleDetail.cs
create mode 100644 DM_Weight/Models/TemperatureHumidityInfo.cs
create mode 100644 DM_Weight/Models/UserList.cs
create mode 100644 DM_Weight/Port/ModbusHelper.cs
create mode 100644 DM_Weight/Port/MyBaseMessage.cs
create mode 100644 DM_Weight/Port/MyMinaCodecFactory.cs
create mode 100644 DM_Weight/Port/MyMinaDecoder.cs
create mode 100644 DM_Weight/Port/MyMinaEncoder.cs
create mode 100644 DM_Weight/Port/PortUtil.cs
create mode 100644 DM_Weight/Port/ScreenUtil.cs
create mode 100644 DM_Weight/Port/SocketHelper.cs
create mode 100644 DM_Weight/Port/TemperatureHumidityJob.cs
create mode 100644 DM_Weight/Report/GridReportUtil.cs
create mode 100644 DM_Weight/ReportTemp/ReturnEmptyDistory_template.grf
create mode 100644 DM_Weight/ReportTemp/account_book_temp.grf
create mode 100644 DM_Weight/ReportTemp/changeShifts_temp.grf
create mode 100644 DM_Weight/ReportTemp/machine_log_add.grf
create mode 100644 DM_Weight/ReportTemp/machine_log_check.grf
create mode 100644 DM_Weight/ReportTemp/machine_log_return.grf
create mode 100644 DM_Weight/ReportTemp/machine_log_take.grf
create mode 100644 DM_Weight/ReportTemp/orderUse_template.grf
create mode 100644 DM_Weight/ReportTemp/stock_template.grf
create mode 100644 DM_Weight/ReportTemp/use_jiaojie.grf
create mode 100644 DM_Weight/Validation/NotEmptyValidationRule.cs
create mode 100644 DM_Weight/ViewModels/AddNewMenuDialogViewModel.cs
create mode 100644 DM_Weight/ViewModels/AdditionWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/BindBoxDialogViewModel.cs
create mode 100644 DM_Weight/ViewModels/BindBoxPackageWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/CheckOrderNewWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/CheckSelfOrderWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/DelUserDialogViewModel.cs
create mode 100644 DM_Weight/ViewModels/DrugBaseWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/EditUserDialogViewModel.cs
create mode 100644 DM_Weight/ViewModels/FingerprintDialogViewModel.cs
create mode 100644 DM_Weight/ViewModels/HomeWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/LoginWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/MachineRecordWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/MainWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/OpenBoxNewWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/OpenBoxWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/RoleManagerWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/SetMenuWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/SettingBoxWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/SettingMainWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/SettingWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/ShowMessageDialogViewModel.cs
create mode 100644 DM_Weight/ViewModels/UserManagerWindowViewModel.cs
create mode 100644 DM_Weight/ViewModels/WSDRecordWindowViewModel.cs
create mode 100644 DM_Weight/Views/AdditionWindow.xaml
create mode 100644 DM_Weight/Views/AdditionWindow.xaml.cs
create mode 100644 DM_Weight/Views/BindBoxPackageWindow.xaml
create mode 100644 DM_Weight/Views/BindBoxPackageWindow.xaml.cs
create mode 100644 DM_Weight/Views/CheckOrderNewWindow.xaml
create mode 100644 DM_Weight/Views/CheckOrderNewWindow.xaml.cs
create mode 100644 DM_Weight/Views/CheckSelfOrderWindow.xaml
create mode 100644 DM_Weight/Views/CheckSelfOrderWindow.xaml.cs
create mode 100644 DM_Weight/Views/Dialog/AddNewMenuDialog.xaml
create mode 100644 DM_Weight/Views/Dialog/AddNewMenuDialog.xaml.cs
create mode 100644 DM_Weight/Views/Dialog/AddSurgeryDialog.xaml
create mode 100644 DM_Weight/Views/Dialog/AddSurgeryDialog.xaml.cs
create mode 100644 DM_Weight/Views/Dialog/BindBoxDialog.xaml
create mode 100644 DM_Weight/Views/Dialog/BindBoxDialog.xaml.cs
create mode 100644 DM_Weight/Views/Dialog/DelUserDialog.xaml
create mode 100644 DM_Weight/Views/Dialog/DelUserDialog.xaml.cs
create mode 100644 DM_Weight/Views/Dialog/EditUserDialog.xaml
create mode 100644 DM_Weight/Views/Dialog/EditUserDialog.xaml.cs
create mode 100644 DM_Weight/Views/Dialog/FingerprintDialog.xaml
create mode 100644 DM_Weight/Views/Dialog/FingerprintDialog.xaml.cs
create mode 100644 DM_Weight/Views/Dialog/ShowMessageDialog.xaml
create mode 100644 DM_Weight/Views/Dialog/ShowMessageDialog.xaml.cs
create mode 100644 DM_Weight/Views/DrugBaseWindow.xaml
create mode 100644 DM_Weight/Views/DrugBaseWindow.xaml.cs
create mode 100644 DM_Weight/Views/HomeWindow.xaml
create mode 100644 DM_Weight/Views/HomeWindow.xaml.cs
create mode 100644 DM_Weight/Views/LoginWindow.xaml
create mode 100644 DM_Weight/Views/LoginWindow.xaml.cs
create mode 100644 DM_Weight/Views/MachineRecordWindow.xaml
create mode 100644 DM_Weight/Views/MachineRecordWindow.xaml.cs
create mode 100644 DM_Weight/Views/MainWindow.xaml
create mode 100644 DM_Weight/Views/MainWindow.xaml.cs
create mode 100644 DM_Weight/Views/OpenBoxNewWindow.xaml
create mode 100644 DM_Weight/Views/OpenBoxNewWindow.xaml.cs
create mode 100644 DM_Weight/Views/OpenBoxWindow.xaml
create mode 100644 DM_Weight/Views/OpenBoxWindow.xaml.cs
create mode 100644 DM_Weight/Views/OrderTakeDrugNewWindow.xaml
create mode 100644 DM_Weight/Views/OrderTakeDrugNewWindow.xaml.cs
create mode 100644 DM_Weight/Views/OrderTakeDrugWindow.xaml
create mode 100644 DM_Weight/Views/OrderTakeDrugWindow.xaml.cs
create mode 100644 DM_Weight/Views/RoleManagerWindow.xaml
create mode 100644 DM_Weight/Views/RoleManagerWindow.xaml.cs
create mode 100644 DM_Weight/Views/SetMenuWindow.xaml
create mode 100644 DM_Weight/Views/SetMenuWindow.xaml.cs
create mode 100644 DM_Weight/Views/SettingBoxWindow.xaml
create mode 100644 DM_Weight/Views/SettingBoxWindow.xaml.cs
create mode 100644 DM_Weight/Views/SettingMainWindow.xaml
create mode 100644 DM_Weight/Views/SettingMainWindow.xaml.cs
create mode 100644 DM_Weight/Views/SettingWindow.xaml
create mode 100644 DM_Weight/Views/SettingWindow.xaml.cs
create mode 100644 DM_Weight/Views/UserManagerWindow.xaml
create mode 100644 DM_Weight/Views/UserManagerWindow.xaml.cs
create mode 100644 DM_Weight/Views/WSDRecordWindow.xaml
create mode 100644 DM_Weight/Views/WSDRecordWindow.xaml.cs
create mode 100644 DM_Weight/favicon.ico
create mode 100644 DM_Weight/log4net.config
create mode 100644 DM_Weight/msg/AddDrugEvent.cs
create mode 100644 DM_Weight/msg/BoxOpenStatusEvent.cs
create mode 100644 DM_Weight/msg/FingerprintEvent.cs
create mode 100644 DM_Weight/msg/IsSelectedEvent.cs
create mode 100644 DM_Weight/msg/LoginOutEvent.cs
create mode 100644 DM_Weight/msg/PortUtilEvent.cs
create mode 100644 DM_Weight/msg/SnackbarEvent.cs
create mode 100644 DM_Weight/select/OrderTakeSelect.cs
create mode 100644 DM_Weight/util/AlertMsg.cs
create mode 100644 DM_Weight/util/BindingProxy.cs
create mode 100644 DM_Weight/util/CheckComputerFreeState.cs
create mode 100644 DM_Weight/util/DeviceMsg.cs
create mode 100644 DM_Weight/util/DialogServiceExtensions.cs
create mode 100644 DM_Weight/util/FingerprintMsg.cs
create mode 100644 DM_Weight/util/GridViewExtensions.cs
create mode 100644 DM_Weight/util/MD5.cs
create mode 100644 DM_Weight/util/MaterialDialogService.cs
create mode 100644 DM_Weight/util/MsgType.cs
create mode 100644 DM_Weight/util/PromiseUtil.cs
create mode 100644 DM_Weight/util/ReadApp.cs
create mode 100644 DM_Weight/util/SqlSugarHelper.cs
create mode 100644 DM_Weight/util/TabTip/AnimationHelper.cs
create mode 100644 DM_Weight/util/TabTip/EnvironmentEx.cs
create mode 100644 DM_Weight/util/TabTip/HardwareKeyboard.cs
create mode 100644 DM_Weight/util/TabTip/PoolingTimer.cs
create mode 100644 DM_Weight/util/TabTip/Screen.cs
create mode 100644 DM_Weight/util/TabTip/TabTip.cs
create mode 100644 DM_Weight/util/TabTip/TabTipAutomation.cs
create mode 100644 DM_Weight/util/TabTip/Taskbar.cs
create mode 100644 DM_Weight/util/TransExpV2.cs
create mode 100644 DM_WeightTests/DM_WeightTests.csproj
create mode 100644 DM_WeightTests/Port/ScreenUtilTests.cs
create mode 100644 说明.txt
diff --git a/DM_Weight.Commons/DM_Weight.Commons.csproj b/DM_Weight.Commons/DM_Weight.Commons.csproj
new file mode 100644
index 0000000..467963e
--- /dev/null
+++ b/DM_Weight.Commons/DM_Weight.Commons.csproj
@@ -0,0 +1,13 @@
+
+
+
+ net6.0-windows
+ enable
+ true
+
+
+
+
+
+
+
diff --git a/DM_Weight.Commons/ValidatRules/ValidationErrorMappingBehavior.cs b/DM_Weight.Commons/ValidatRules/ValidationErrorMappingBehavior.cs
new file mode 100644
index 0000000..fce3c87
--- /dev/null
+++ b/DM_Weight.Commons/ValidatRules/ValidationErrorMappingBehavior.cs
@@ -0,0 +1,75 @@
+using Microsoft.Xaml.Behaviors;
+using System.Collections.ObjectModel;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace DM_Weight.Commons.ValidatRules
+{
+ public class ValidationErrorMappingBehavior : Behavior
+ {
+ #region Properties
+
+ public static readonly DependencyProperty ValidationErrorsProperty =
+ DependencyProperty.Register("ValidationErrors", typeof(ObservableCollection),
+ typeof(ValidationErrorMappingBehavior), new PropertyMetadata(new ObservableCollection()));
+
+ public ObservableCollection ValidationErrors
+ {
+ get { return (ObservableCollection)this.GetValue(ValidationErrorsProperty); }
+ set { this.SetValue(ValidationErrorsProperty, value); }
+ }
+
+ public static readonly DependencyProperty HasValidationErrorProperty = DependencyProperty.Register("HasValidationError",
+ typeof(bool), typeof(ValidationErrorMappingBehavior), new PropertyMetadata(false));
+
+ public bool HasValidationError
+ {
+ get { return (bool)this.GetValue(HasValidationErrorProperty); }
+ set { this.SetValue(HasValidationErrorProperty, value); }
+ }
+
+ #endregion
+
+ #region Constructors
+
+ public ValidationErrorMappingBehavior()
+ : base()
+ { }
+
+ #endregion
+
+ #region Events & Event Methods
+
+ private void Validation_Error(object sender, ValidationErrorEventArgs e)
+ {
+ if (e.Action == ValidationErrorEventAction.Added)
+ {
+ this.ValidationErrors.Add(e.Error);
+ }
+ else
+ {
+ this.ValidationErrors.Remove(e.Error);
+ }
+
+ this.HasValidationError = this.ValidationErrors.Count > 0;
+ }
+
+ #endregion
+
+ #region Support Methods
+
+ protected override void OnAttached()
+ {
+ base.OnAttached();
+ Validation.AddErrorHandler(this.AssociatedObject, Validation_Error);
+ }
+
+ protected override void OnDetaching()
+ {
+ base.OnDetaching();
+ Validation.RemoveErrorHandler(this.AssociatedObject, Validation_Error);
+ }
+
+ #endregion
+ }
+}
diff --git a/DM_Weight.sln b/DM_Weight.sln
new file mode 100644
index 0000000..1e50fcf
--- /dev/null
+++ b/DM_Weight.sln
@@ -0,0 +1,51 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.3.32922.545
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DM_Weight", "DM_Weight\DM_Weight.csproj", "{439FA76B-F874-40DB-BAF2-E3647CD55B10}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DM_Weight.Commons", "DM_Weight.Commons\DM_Weight.Commons.csproj", "{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|x64.ActiveCfg = Debug|x64
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|x64.Build.0 = Debug|x64
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|x86.ActiveCfg = Debug|x86
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|x86.Build.0 = Debug|x86
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|Any CPU.ActiveCfg = Debug|Any CPU
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|Any CPU.Build.0 = Debug|Any CPU
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x64.ActiveCfg = Release|x64
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x64.Build.0 = Release|x64
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x86.ActiveCfg = Debug|x86
+ {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x86.Build.0 = Debug|x86
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|x64.Build.0 = Debug|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|x86.Build.0 = Debug|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|x64.ActiveCfg = Release|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|x64.Build.0 = Release|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|x86.ActiveCfg = Release|Any CPU
+ {7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {E50E8179-1102-41F1-92F5-2905C75898A6}
+ EndGlobalSection
+EndGlobal
diff --git a/DM_Weight/App.config b/DM_Weight/App.config
new file mode 100644
index 0000000..3969b3e
--- /dev/null
+++ b/DM_Weight/App.config
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DM_Weight/App.xaml b/DM_Weight/App.xaml
new file mode 100644
index 0000000..704fc50
--- /dev/null
+++ b/DM_Weight/App.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DM_Weight/App.xaml.cs b/DM_Weight/App.xaml.cs
new file mode 100644
index 0000000..f1d140d
--- /dev/null
+++ b/DM_Weight/App.xaml.cs
@@ -0,0 +1,338 @@
+using DM_Weight.Finger;
+using DM_Weight.Port;
+using DM_Weight.util.TabTip;
+using DM_Weight.util;
+using DM_Weight.ViewModels;
+using DM_Weight.Views.Dialog;
+using DM_Weight.Views;
+using log4net.Config;
+using Prism.Ioc;
+using Prism.Services.Dialogs;
+using System;
+using System.IO;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using Prism.Unity;
+using log4net;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+
+namespace DM_Weight
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : PrismApplication
+ {
+ private readonly ILog logger = LogManager.GetLogger(typeof(App));
+ public App()
+ {
+ TabTipAutomation.IgnoreHardwareKeyboard = HardwareKeyboardIgnoreOptions.IgnoreAll;
+ TabTipAutomation.BindTo();
+ TabTipAutomation.BindTo();
+ }
+
+
+
+ protected override Window CreateShell()
+ {
+ logger.Info("进入APP-CreateShell");
+ //UI线程未捕获异常处理事件
+ this.DispatcherUnhandledException += OnDispatcherUnhandledException;
+ //Task线程内未捕获异常处理事件
+ TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;
+ //多线程异常
+ AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
+
+ logger.Info("进入APP-CreateShell-2");
+ return Container.Resolve();
+ }
+
+ void OnDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
+ {
+ logger.Error($"发生错误:{e.Exception.Message}");
+ e.Handled = true;
+ }
+
+ void OnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
+ {
+
+ foreach (Exception item in e.Exception.InnerExceptions)
+ {
+ logger.Error($"异常类型:{item.GetType()}{Environment.NewLine}来自:{item.Source}{Environment.NewLine}异常内容:{item.Message}");
+ }
+
+ //将异常标识为已经观察到
+ e.SetObserved();
+ }
+
+ void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
+ {
+ logger.Error($"Unhandled exception.{e.ToString()}");
+ }
+
+
+ protected override void InitializeShell(Window shell)
+ {
+
+ base.InitializeShell(shell);
+ }
+
+ protected override void RegisterTypes(IContainerRegistry containerRegistry)
+ {
+
+ logger.Info("进入APP-RegisterTypes");
+ // 注入日志
+ XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config"));
+ //containerRegistry.RegisterInstance(LogManager.GetLogger(""));
+
+ // 串口工具
+ containerRegistry.RegisterSingleton();
+ containerRegistry.RegisterSingleton();
+ // 指纹机工具
+ containerRegistry.RegisterSingleton();
+ // 组态屏工具
+ //containerRegistry.RegisterSingleton();
+ // 录像机
+ //containerRegistry.RegisterSingleton();
+
+ containerRegistry.Register();
+
+ // 主窗口
+ containerRegistry.Register();
+ containerRegistry.RegisterForNavigation();
+
+ // 分页
+ //containerRegistry.Register();
+ //containerRegistry.Register();
+
+ // 登录页面
+ containerRegistry.RegisterForNavigation();
+
+ // 布局页面
+ containerRegistry.RegisterForNavigation();
+
+ // 录入指纹模态框
+ containerRegistry.RegisterDialog();
+ containerRegistry.RegisterForNavigation();
+
+
+ #region 取药
+ // 处方取药页面
+ //containerRegistry.RegisterForNavigation();
+
+
+ //containerRegistry.RegisterForNavigation();
+ //containerRegistry.RegisterForNavigation();
+ //containerRegistry.RegisterForNavigation();
+ ////交接柜补药
+ //containerRegistry.RegisterForNavigation();
+
+ // 处方取药模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ //// 调拨取药页面
+ //containerRegistry.RegisterForNavigation();
+ //// 调拨取药模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ //// 抽屉取药页面
+ //containerRegistry.RegisterForNavigation();
+ //// 自选取药模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ //// 自选取药页面
+ //containerRegistry.RegisterForNavigation();
+
+ ////多处方取药
+ //containerRegistry.RegisterForNavigation();
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+
+ ////手术排程
+ //containerRegistry.RegisterForNavigation();
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ //开药箱
+ containerRegistry.RegisterForNavigation();
+ containerRegistry.RegisterForNavigation();
+ //交接柜补药
+ containerRegistry.RegisterForNavigation();
+ //核对处方
+ //containerRegistry.RegisterForNavigation();
+ //管理员根据药箱进行核对处方
+ containerRegistry.RegisterForNavigation();
+ //麻醉师核对其名下单子
+ containerRegistry.RegisterForNavigation();
+
+
+
+ #endregion
+
+ //#region 加药
+ // 自选加药页面
+ //containerRegistry.RegisterForNavigation();
+ //// 调拨加药页面
+ //containerRegistry.RegisterForNavigation();
+
+ //// 调拨取药模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ //// 抽屉加药页面
+ //containerRegistry.RegisterForNavigation();
+ //// 自选加药模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ ////多批次抽屉加药
+ //containerRegistry.RegisterForNavigation();
+ ////药品请领
+ //containerRegistry.RegisterForNavigation();
+ //// 药品请领模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+
+ ////请领列表
+ //containerRegistry.RegisterForNavigation();
+ ////请领入库
+ //containerRegistry.RegisterForNavigation();
+
+ //#endregion
+
+ //#region 还药
+ //// 还药页面
+ //containerRegistry.RegisterForNavigation();
+ //// 按记录归还药品模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+
+ //// 还药页面2
+ //containerRegistry.RegisterForNavigation();
+ //// 按处方归还药品模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ //// 还空瓶页面
+ //containerRegistry.RegisterForNavigation();
+
+ ////空瓶销毁页面
+ //containerRegistry.RegisterForNavigation();
+
+ //// 归还空瓶模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ //// 空瓶销毁模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+
+
+ //#endregion
+
+ //#region 库存管理
+ //// 库存列表页面
+ //containerRegistry.RegisterForNavigation();
+ //// 库位绑定模态框
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+ ////同一药品多批次库位绑定
+ //containerRegistry.RegisterForNavigation();
+ //// 库存盘点页面
+ //containerRegistry.RegisterForNavigation();
+ //// 药品列表页面
+ //containerRegistry.RegisterForNavigation();
+
+ ////交接班记录
+ //containerRegistry.RegisterForNavigation();
+ ////交接班弹窗
+ //containerRegistry.RegisterDialog();
+ //containerRegistry.RegisterForNavigation();
+
+ //containerRegistry.RegisterForNavigation();
+ //#endregion
+
+ #region 系统设置
+ // 用户管理页面
+ containerRegistry.RegisterForNavigation();
+ // 编辑用户模态框
+ containerRegistry.RegisterDialog();
+ containerRegistry.RegisterForNavigation();
+ containerRegistry.RegisterDialog();
+ containerRegistry.RegisterForNavigation();
+ // 角色管理页面
+ containerRegistry.RegisterForNavigation();
+ // 系统设置
+ containerRegistry.RegisterForNavigation();
+ // 调试页面
+ //containerRegistry.RegisterForNavigation();
+ //主设置页面
+ containerRegistry.RegisterForNavigation();
+ //两个冰箱抽屉设置页面
+ //containerRegistry.RegisterForNavigation();
+ ////只有一个冰箱抽屉设置页面
+ //containerRegistry.RegisterForNavigation();
+ //药箱绑定
+ containerRegistry.RegisterForNavigation();
+ //药箱设置
+ containerRegistry.RegisterForNavigation();
+
+ //操作记录
+ containerRegistry.RegisterForNavigation();
+ //温湿度记录
+ containerRegistry.RegisterForNavigation();
+
+ containerRegistry.RegisterForNavigation();
+ containerRegistry.RegisterDialog();
+ containerRegistry.RegisterForNavigation();
+ #endregion
+
+ // 设备记录页面
+ //containerRegistry.RegisterForNavigation();
+
+ containerRegistry.RegisterForNavigation();
+
+ logger.Info("结束APP-RegisterTypes");
+
+ }
+
+ private void PrismApplication_Startup(object sender, StartupEventArgs e)
+ {
+ //获取欲启动程序名
+ string processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
+ logger.Info($"欲启动程序名:{processName}");
+ //检查程序是否已经启动,已经启动则显示提示退出程序
+ if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1)
+ {
+
+ logger.Info($"系统在运行!");
+ //系统在运行
+ RaiseOtherProcess();
+ Application.Current.Shutdown();
+ return;
+ }
+ }
+ private static void RaiseOtherProcess()
+ {
+ Process proc = Process.GetCurrentProcess();
+ foreach (Process otherProc in Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName))
+ {
+ if (proc.Id != otherProc.Id)
+ {
+ IntPtr hWnd = otherProc.MainWindowHandle;
+ if (IsIconic(hWnd))
+ {
+ ShowWindowAsync(hWnd, 9);
+ }
+ SetForegroundWindow(hWnd);
+ break;
+ }
+ }
+ }
+ [DllImport("user32.dll")]
+ private static extern bool SetForegroundWindow(IntPtr hWnd);
+ [DllImport("user32.dll")]
+ private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
+ [DllImport("user32.dll")]
+ private static extern bool IsIconic(IntPtr hWnd);
+ }
+}
diff --git a/DM_Weight/AssemblyInfo.cs b/DM_Weight/AssemblyInfo.cs
new file mode 100644
index 0000000..8b5504e
--- /dev/null
+++ b/DM_Weight/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
diff --git a/DM_Weight/Common/CRC16MODBUS.cs b/DM_Weight/Common/CRC16MODBUS.cs
new file mode 100644
index 0000000..6384cf7
--- /dev/null
+++ b/DM_Weight/Common/CRC16MODBUS.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DM_Weight.Common
+{
+ public class CRC16MODBUS
+ {
+ /// Name: CRC-16/MODBUS x16+x15+x2+1
+ /// Poly: 0x8005
+ /// Init: 0xFFFF
+ /// Refin: true
+ /// Refout: true
+ /// Xorout: 0x0000
+ ///******************************添加数据CRC16MODBUS校验位*******************************************
+ public static byte[] CrcModBus(byte[] buffer, int start = 0, int len = 0)
+ {
+ if (buffer == null || buffer.Length == 0) return null;
+ if (start < 0) return null;
+ if (len == 0) len = buffer.Length - start;
+ int length = start + len;
+ if (length > buffer.Length) return null;
+ ushort crc = 0xFFFF;// Initial value
+ for (int i = start; i < length; i++)
+ {
+ crc ^= buffer[i];
+ for (int j = 0; j < 8; j++)
+ {
+ if ((crc & 1) > 0)
+ crc = (ushort)((crc >> 1) ^ 0xA001);// 0xA001 = reverse 0x8005
+ else
+ crc = (ushort)(crc >> 1);
+ }
+ }
+ byte[] ret = BitConverter.GetBytes(crc);
+ //Array.Reverse(ret);
+ return ret;
+ }
+ }
+}
diff --git a/DM_Weight/Common/CommonClass.cs b/DM_Weight/Common/CommonClass.cs
new file mode 100644
index 0000000..daf7730
--- /dev/null
+++ b/DM_Weight/Common/CommonClass.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml;
+
+namespace DM_Weight.Common
+{
+ public class CommonClass
+ {
+ //手动实现调用配置的逻辑 规避修改配置文件后不起作用的问题
+ public static string ReadAppSetting(string key)
+ {
+ string xPath = "/configuration/appSettings//add[@key='" + key + "']";
+ XmlDocument doc = new XmlDocument();
+ string exeFileName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
+ doc.Load(exeFileName + ".dll.config");
+ XmlNode node = doc.SelectSingleNode(xPath);
+ return node.Attributes["value"].Value;
+ }
+ public static void SaveAppSetting(string key,string value)
+ {
+ Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+ _configuration.AppSettings.Settings[key].Value = value;
+ _configuration.Save();
+ ConfigurationManager.RefreshSection(key);
+ }
+ }
+}
diff --git a/DM_Weight/Common/PrismManager.cs b/DM_Weight/Common/PrismManager.cs
new file mode 100644
index 0000000..459848b
--- /dev/null
+++ b/DM_Weight/Common/PrismManager.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DM_Weight.Common
+{
+ public class PrismManager
+ {
+ /////
+ ///// 主页面区域,主要呈现登录页及登录后页面
+ /////
+ //public static readonly string MainViewRegionName = "MainContent";
+ ///
+ /// 设置菜单页面跳转,主要呈现设置下子菜单
+ ///
+ public static readonly string SettingViewRegionName = "SettingViewContent";
+ /////
+ ///// 主页面各菜单页
+ /////
+ //public static readonly string HomeViewRegionName = "HomeViewContent";
+ }
+}
diff --git a/DM_Weight/Common/TemperatureRangeRule.cs b/DM_Weight/Common/TemperatureRangeRule.cs
new file mode 100644
index 0000000..111c8b2
--- /dev/null
+++ b/DM_Weight/Common/TemperatureRangeRule.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+using System.Windows.Data;
+
+namespace DM_Weight.Common
+{
+ //设置冰箱温度规则
+ public class TemperatureRangeRule : ValidationRule
+ {
+ //冰箱温度设置区间为取自配置文件(2~8度)
+ public override ValidationResult Validate(object value, CultureInfo cultureInfo)
+ {
+ bool flag = false;
+ string tips = string.Empty;
+ try
+ {
+ string[] rang = value.ToString().Split('-');
+ if (rang.Length >= 2)
+ {
+ bool bSRange = int.TryParse(rang[0], out int sRange);
+ bool bERange = int.TryParse(rang[1], out int eRange);
+ if (bSRange && bERange)
+ {
+ if ((sRange < 2 || eRange > 8||sRange>8||eRange<2))
+ {
+ tips = "温度区间设置2-8度,请检查输入";
+ return new ValidationResult(flag, tips);
+ }
+ else
+ {
+ flag = true;
+ }
+ }
+ else
+ {
+ tips = "请输入正确的数值";
+ return new ValidationResult(flag, tips);
+ }
+
+ }
+ else
+ {
+ tips = "请输入正确的数值";
+ return new ValidationResult(flag, tips);
+ }
+ return new ValidationResult(flag, tips);
+ }
+ catch (Exception ex)
+ {
+ tips = $"校验异常{ex.ToString()}";
+ return new ValidationResult(flag, tips);
+ }
+ }
+ }
+}
diff --git a/DM_Weight/Components/pagination/Pagination.xaml b/DM_Weight/Components/pagination/Pagination.xaml
new file mode 100644
index 0000000..8b3eee6
--- /dev/null
+++ b/DM_Weight/Components/pagination/Pagination.xaml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DM_Weight/Components/pagination/Pagination.xaml.cs b/DM_Weight/Components/pagination/Pagination.xaml.cs
new file mode 100644
index 0000000..3b404f6
--- /dev/null
+++ b/DM_Weight/Components/pagination/Pagination.xaml.cs
@@ -0,0 +1,265 @@
+using NetTaste;
+using Prism.Commands;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace DM_Weight.Components.pagination
+{
+ ///
+ /// Pagination.xaml 的交互逻辑
+ ///
+ public partial class Pagination : UserControl
+ {
+ public Pagination()
+ {
+ InitializeComponent();
+ ResetInfoText();
+ ResetCurrentPageText();
+ }
+
+ static Pagination()
+ {
+ InitializeCommands();
+
+ }
+
+ private static readonly Type _typeofSelf = typeof(Pagination);
+
+
+ private static void InitializeCommands()
+ {
+ FirstCommand = new RoutedCommand("First", _typeofSelf);
+ PrevCommand = new RoutedCommand("Prev", _typeofSelf);
+ NextCommand = new RoutedCommand("Next", _typeofSelf);
+ EndCommand = new RoutedCommand("End", _typeofSelf);
+
+
+ CommandManager.RegisterClassCommandBinding(_typeofSelf,
+ new CommandBinding(FirstCommand, OnFirstComman, OnCanFirstComman));
+ CommandManager.RegisterClassCommandBinding(_typeofSelf,
+ new CommandBinding(PrevCommand, OnPrevCommand, OnCanPrevCommand));
+ CommandManager.RegisterClassCommandBinding(_typeofSelf,
+ new CommandBinding(NextCommand, OnNextCommand, OnCanNextCommand));
+ CommandManager.RegisterClassCommandBinding(_typeofSelf,
+ new CommandBinding(EndCommand, OnEndCommand, OnCanEndCommand));
+ }
+
+
+
+ public static RoutedCommand FirstCommand { get; private set; }
+ private static void OnFirstComman(object sender, RoutedEventArgs e)
+ {
+ var ctrl = sender as Pagination;
+ ctrl.CurrentPage = 1;
+ }
+
+ private static void OnCanFirstComman(object sender, CanExecuteRoutedEventArgs e)
+ {
+ var ctrl = sender as Pagination;
+ e.CanExecute = ctrl.CurrentPage > 1;
+ }
+
+ public static RoutedCommand PrevCommand { get; private set; }
+ private static void OnPrevCommand(object sender, RoutedEventArgs e)
+ {
+ var ctrl = sender as Pagination;
+ ctrl.CurrentPage--;
+ }
+
+ private static void OnCanPrevCommand(object sender, CanExecuteRoutedEventArgs e)
+ {
+ var ctrl = sender as Pagination;
+ e.CanExecute = ctrl.CurrentPage > 1;
+ }
+
+ public static RoutedCommand NextCommand { get; private set; }
+
+ private static void OnNextCommand(object sender, RoutedEventArgs e)
+ {
+ var ctrl = sender as Pagination;
+ ctrl.CurrentPage++;
+ }
+
+ private static void OnCanNextCommand(object sender, CanExecuteRoutedEventArgs e)
+ {
+ var ctrl = sender as Pagination;
+ e.CanExecute = ctrl.CurrentPage < ctrl.PageCount;
+ }
+ public static RoutedCommand EndCommand { get; private set; }
+ private static void OnEndCommand(object sender, RoutedEventArgs e)
+ {
+ var ctrl = sender as Pagination;
+ ctrl.CurrentPage = ctrl.PageCount;
+ }
+
+ private static void OnCanEndCommand(object sender, CanExecuteRoutedEventArgs e)
+ {
+ var ctrl = sender as Pagination;
+ e.CanExecute = ctrl.CurrentPage < ctrl.PageCount;
+ }
+
+
+
+ // 默认当前页码
+ public static int DefaultCurrentPage = 1;
+ // 默认总条数
+ public static int DefaultTotalPages = 0;
+ // 默认每页条数列表
+ public static List DefaultPageSizeList = new List { 10, 20, 50, 100 };
+ // 是否显示页码条数信息
+ public static bool DefaultInfoTextIsEnabel = true;
+ // 默认每页条数
+ public static int DefaultPageSize = 10;
+
+
+ public static readonly DependencyProperty CurrentPageProperty = DependencyProperty
+ .Register("CurrentPage",
+ typeof(int),
+ typeof(Pagination),
+ new FrameworkPropertyMetadata(DefaultCurrentPage, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
+ public static readonly DependencyProperty PageSizeProperty = DependencyProperty
+ .Register("PageSize",
+ typeof(int),
+ typeof(Pagination),
+ new FrameworkPropertyMetadata(DefaultPageSize, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
+ public static readonly DependencyProperty TotalPagesProperty = DependencyProperty
+ .Register("TotalPages",
+ typeof(int),
+ typeof(Pagination),
+ new FrameworkPropertyMetadata(DefaultTotalPages, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(OnItemsSourceChanged)));
+ public static readonly DependencyProperty InfoTextIsEnabelProperty = DependencyProperty
+ .Register("InfoTextIsEnabel",
+ typeof(bool),
+ typeof(Pagination),
+ new FrameworkPropertyMetadata(DefaultInfoTextIsEnabel, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
+ private static void OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ Pagination p = (Pagination)d;
+
+ p.ResetInfoText();
+ }
+
+ [Bindable(true)]
+ [Category("Appearance")]
+ public int CurrentPage
+ {
+ get { return (int)GetValue(CurrentPageProperty); }
+ set
+ {
+ SetValue(CurrentPageProperty, value);
+ if (InfoTextIsEnabel)
+ {
+ ResetInfoText();
+ }
+ ResetCurrentPageText();
+ }
+ }
+
+
+ //private static void OnCurrentPageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ //{
+ // Pagination p = d as Pagination;
+
+ // if (p != null)
+ // {
+ // Console.WriteLine(e.NewValue);
+ // }
+ //}
+
+ [Bindable(true)]
+ [Category("Appearance")]
+ public int PageSize
+ {
+ get { return (int)GetValue(PageSizeProperty); }
+ set
+ {
+ SetValue(PageSizeProperty, value);
+ if (InfoTextIsEnabel)
+ {
+ ResetInfoText();
+ }
+ ResetCurrentPageText();
+ }
+ }
+
+
+ [Bindable(true)]
+ [Category("Appearance")]
+ public int TotalPages
+ {
+ get { return (int)GetValue(TotalPagesProperty); }
+ set
+ {
+ SetValue(TotalPagesProperty, value);
+ if (InfoTextIsEnabel)
+ {
+ ResetInfoText();
+ }
+ ResetCurrentPageText();
+ }
+ }
+
+ public bool InfoTextIsEnabel
+ {
+ get { return (bool)GetValue(InfoTextIsEnabelProperty); }
+ set { SetValue(InfoTextIsEnabelProperty, value); }
+ }
+
+ public int PageCount
+ {
+ get => (int)Math.Ceiling((double)TotalPages / PageSize);
+ }
+
+
+ public void ResetInfoText()
+ {
+ this.Dispatcher.BeginInvoke(() =>
+ {
+ if (InfoTextIsEnabel)
+ {
+ if (TotalPages <= PageSize)
+ {
+ this.InfoBlock.Text = $"1-{TotalPages}/{TotalPages}";
+ if (TotalPages == 0)
+ {
+ this.InfoBlock.Text = $"0-{TotalPages}/{TotalPages}";
+ }
+ } else
+ {
+ this.InfoBlock.Text = ((CurrentPage - 1) * PageSize + 1) + "-" + (CurrentPage * PageSize > TotalPages ? TotalPages : CurrentPage * PageSize) + "/" + TotalPages;
+ }
+
+ } else
+ {
+ this.InfoBlock.Visibility = Visibility.Visible;
+ }
+
+ });
+
+ }
+
+ public void ResetCurrentPageText()
+ {
+ this.Dispatcher.BeginInvoke(() =>
+ {
+ this.CurrentPageText.Text = CurrentPage + "";
+ });
+
+ }
+
+ }
+}
diff --git a/DM_Weight/Components/pagination/PaginationViewModel.cs b/DM_Weight/Components/pagination/PaginationViewModel.cs
new file mode 100644
index 0000000..00a7f0b
--- /dev/null
+++ b/DM_Weight/Components/pagination/PaginationViewModel.cs
@@ -0,0 +1,81 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace DM_Weight.Components.pagination
+{
+ public class PaginationViewModel: BindableBase, IRegionMemberLifetime
+ {
+ public static readonly DependencyProperty PageSizeProperty = DependencyProperty
+ .Register("CurrentPage",
+ typeof(int),
+ typeof(Pagination),
+ new FrameworkPropertyMetadata(10));
+
+ // 每页条数
+ private int _pageSize = 10;
+ // 当前页码
+ private int _currentPage = 1;
+ // 总条数
+ private int _totalPages = 0;
+
+ public int PageSize { get=> _pageSize; set => SetProperty(ref _pageSize, value); }
+ public int CurrentPage { get => _currentPage; set => SetProperty(ref _currentPage, value); }
+ public int TotalPages { get => _totalPages; set => SetProperty(ref _totalPages, value); }
+ // 总页数
+ public int PageCount
+ {
+ get => (int)Math.Ceiling((double)TotalPages/ PageSize);
+ }
+
+ public string InfoText
+ {
+ get => ((CurrentPage - 1) * PageSize + 1) + "-" + (CurrentPage * PageSize > TotalPages ? TotalPages : CurrentPage * PageSize) + "/" + TotalPages;
+ }
+
+ public bool KeepAlive => false;
+
+
+ public DelegateCommand ToFirst
+ {
+ get => new(() =>
+ {
+ CurrentPage = 1;
+ });
+ }
+
+
+
+ public DelegateCommand ToPrve
+ {
+ get => new(() =>
+ {
+ CurrentPage -= 1;
+ });
+ }
+
+ public DelegateCommand ToNext
+ {
+ get => new(() =>
+ {
+ CurrentPage += 1;
+ });
+ }
+
+ public DelegateCommand ToEnd
+ {
+ get => new(() =>
+ {
+ CurrentPage = PageCount;
+ });
+ }
+
+
+ }
+}
diff --git a/DM_Weight/Converter/AddUnitConverter.cs b/DM_Weight/Converter/AddUnitConverter.cs
new file mode 100644
index 0000000..ba3eea9
--- /dev/null
+++ b/DM_Weight/Converter/AddUnitConverter.cs
@@ -0,0 +1,31 @@
+using DM_Weight.Models;
+using DM_Weight.util;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace DM_Weight.Converter
+{
+ public class AddUnitConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ int val = int.Parse(value.ToString());
+ if (val <= 0)
+ {
+ return "";
+ }
+ string userName = SqlSugarHelper.Db.Queryable().Where(ul => ul.Id == val).Select(ul => new { ul.Nickname }).First().Nickname;
+ return userName;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/DM_Weight/Converter/ApplyListConverter.cs b/DM_Weight/Converter/ApplyListConverter.cs
new file mode 100644
index 0000000..042d543
--- /dev/null
+++ b/DM_Weight/Converter/ApplyListConverter.cs
@@ -0,0 +1,91 @@
+using DM_Weight.Models;
+using DM_Weight.util;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Configuration;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace DM_Weight.Converter
+{
+ ///
+ /// 请领列表页面状态转换
+ ///
+ public class ApplyListConverter : IValueConverter
+ {
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ //用户名
+ if (parameter.ToString().Equals("UserId"))
+ {
+ int val = int.Parse(value.ToString());
+ if (val <= 0)
+ {
+ return "";
+ }
+ string userName = SqlSugarHelper.Db.Queryable().Where(ul => ul.Id == val).Select(ul => new { ul.Nickname }).First().Nickname;
+ return userName;
+ }
+ //请领单状态
+ if (parameter.ToString().Equals("PleaseStatus"))
+ {
+ int val = int.Parse(value.ToString());
+ string retStr = "状态:";
+ switch (val)
+ {
+ case 0:
+ return retStr + "已创建";
+ case 1:
+ return retStr + "审核通过";
+ case 2:
+ return retStr + "已出库";
+ case 3:
+ return retStr + "已入库";
+ default:
+ return retStr + "状态未知";
+ }
+ }
+ //处方状态
+ if (parameter.ToString().Equals("OrderStatus"))
+ {
+ int val = int.Parse(value.ToString());
+ switch (val)
+ {
+ case 0:
+ return "已申请";
+ case 1:
+ return "已接收";
+ case 2:
+ return "已退回";
+ default:
+ return "状态未知";
+ }
+ }
+ //请领药库
+ if (parameter.ToString().Equals("machineId"))
+ {
+ string val = value.ToString();
+ string[] colloctedId = ConfigurationManager.AppSettings["colloctedId"].Split(',');
+ if (Array.IndexOf(colloctedId, val)>0)
+ {
+ return colloctedId[Array.IndexOf(colloctedId, val) - 1].ToString();
+ }
+ else
+ {
+ return "未知";
+ }
+ }
+ return "";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/DM_Weight/Converter/BoardTypeConverter.cs b/DM_Weight/Converter/BoardTypeConverter.cs
new file mode 100644
index 0000000..54e5382
--- /dev/null
+++ b/DM_Weight/Converter/BoardTypeConverter.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace DM_Weight.Converter
+{
+ public class BoardTypeConverter : IMultiValueConverter
+ {
+ public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
+ {
+ int BoardType = int.Parse(value[0].ToString());
+ int DrawerType = int.Parse(value[1].ToString());
+ switch (BoardType)
+ {
+ case 1:
+ if (DrawerType == 1)
+ {
+ return "物理隔断";
+ }
+ else if(DrawerType == 2)
+ {
+ return "内置回收";
+ }
+ else
+ {
+ return "外置回收";
+ }
+ case 2:
+ if (DrawerType == 1)
+ {
+ return "单支计数";
+ }
+ else if (DrawerType == 2)
+ {
+ return "计数回收(内置)";
+ }
+ else
+ {
+ return "计数回收(外置)";
+ }
+ case 3:
+ if (DrawerType == 1)
+ {
+ return "管控药盒";
+ }
+ else if (DrawerType == 2)
+ {
+ return "药盒回收(内置)";
+ }
+ else
+ {
+ return "外置回收";
+ }
+ case 4:
+ if (DrawerType == 1)
+ {
+ return "储物箱";
+ }
+ else if (DrawerType == 2)
+ {
+ return "内置回收";
+ }
+ else
+ {
+ return "外置回收";
+ }
+ case 5:
+ if (DrawerType == 1)
+ {
+ return "智能显示";
+ }
+ else if (DrawerType == 2)
+ {
+ return "内置回收";
+ }
+ else
+ {
+ return "外置回收";
+ }
+ case 6:
+ if (DrawerType == 1)
+ {
+ return "称重计数";
+ }
+ else if (DrawerType == 2)
+ {
+ return "称重回收(内置)";
+ }
+ else
+ {
+ return "计数回收(外置)";
+ }
+ }
+ return "";
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/DM_Weight/Converter/BoxNumConverter.cs b/DM_Weight/Converter/BoxNumConverter.cs
new file mode 100644
index 0000000..6143068
--- /dev/null
+++ b/DM_Weight/Converter/BoxNumConverter.cs
@@ -0,0 +1,31 @@
+using SqlSugar.Extensions;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace DM_Weight.Converter
+{
+ class BoxNumConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if(parameter==null)
+ {
+ return value.ObjToBool();
+ }
+ string str=value.ToString();
+ return !(str == parameter.ToString());
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+
+ }
+ }
+}
diff --git a/DM_Weight/Converter/DrawerSelectConverter.cs b/DM_Weight/Converter/DrawerSelectConverter.cs
new file mode 100644
index 0000000..c87c7d2
--- /dev/null
+++ b/DM_Weight/Converter/DrawerSelectConverter.cs
@@ -0,0 +1,88 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace DM_Weight.Converter
+{
+ internal class DrawerSelectConverter : IMultiValueConverter
+ {
+ public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
+ {
+ //int iLength = value[0].ToString().Length;
+ int iLength = value[0].ToString().IndexOf("号手术间");
+ string StrButtonDrawerNo =value[0].ToString().Substring(0, iLength);
+ int ButtonDrawerNo = -1;
+ switch (StrButtonDrawerNo)
+ {
+ case "一":
+ ButtonDrawerNo = 0;
+ break;
+ case "二":
+ ButtonDrawerNo = 1;
+ break;
+ case "三":
+ ButtonDrawerNo = 2;
+ break;
+ case "四":
+ ButtonDrawerNo = 3;
+ break;
+ case "五":
+ ButtonDrawerNo = 4;
+ break;
+ case "六":
+ ButtonDrawerNo = 5;
+ break;
+ case "七":
+ ButtonDrawerNo = 6;
+ break;
+ case "八":
+ ButtonDrawerNo = 7;
+ break;
+ case "九":
+ ButtonDrawerNo = 8;
+ break;
+ case "十":
+ ButtonDrawerNo = 9;
+ break;
+ case "十一":
+ ButtonDrawerNo = 10;
+ break;
+ case "十二":
+ ButtonDrawerNo = 11;
+ break;
+ case "十三":
+ ButtonDrawerNo = 12;
+ break;
+ case "十四":
+ ButtonDrawerNo = 13;
+ break;
+ case "十五":
+ ButtonDrawerNo = 14;
+ break;
+ case "十六":
+ ButtonDrawerNo = 15;
+ break;
+ case "十七":
+ ButtonDrawerNo = 16;
+ break;
+ case "十八":
+ ButtonDrawerNo = 17;
+ break;
+ default:
+ break;
+ }
+ int SelectedDrawerNo = int.Parse(value[1].ToString());
+ return ButtonDrawerNo == SelectedDrawerNo;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/DM_Weight/Converter/ForeColorConverter.cs b/DM_Weight/Converter/ForeColorConverter.cs
new file mode 100644
index 0000000..5c0ea45
--- /dev/null
+++ b/DM_Weight/Converter/ForeColorConverter.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace DM_Weight.Converter
+{
+ public class ForeColorConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if ((bool)value)
+ {
+ return "#3ECFED";
+ }
+ else
+ {
+ return "#808080";
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/DM_Weight/Converter/GroupSumConverter.cs b/DM_Weight/Converter/GroupSumConverter.cs
new file mode 100644
index 0000000..a328392
--- /dev/null
+++ b/DM_Weight/Converter/GroupSumConverter.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using DM_Weight.Models;
+
+namespace DM_Weight.Converter
+{
+ public class GroupSumConverter : IValueConverter
+ {
+ #region 分组组内求和
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ var total = 0;
+ // DataGrid分组后对应的组及组内元素CollectionViewGroup.Items 类型是ReadOnlyObservableCollection