diff --git a/DM_Weight.sln b/DM_Weight.sln new file mode 100644 index 0000000..9c198ec --- /dev/null +++ b/DM_Weight.sln @@ -0,0 +1,25 @@ + +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 +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + 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}.Release|Any CPU.ActiveCfg = Release|Any CPU + {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|Any CPU.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..e5668a5 --- /dev/null +++ b/DM_Weight/App.config @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DM_Weight/App.xaml b/DM_Weight/App.xaml new file mode 100644 index 0000000..ef8d445 --- /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..48f15ef --- /dev/null +++ b/DM_Weight/App.xaml.cs @@ -0,0 +1,210 @@ +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.Collections.Generic; +using System.ComponentModel; +using System.Configuration; +using System.Data; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using Prism.Unity; +using log4net; +using System.Windows.Interop; +using System.Windows.Threading; +using System.Timers; + +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() + { + //UI线程未捕获异常处理事件 + this.DispatcherUnhandledException += OnDispatcherUnhandledException; + //Task线程内未捕获异常处理事件 + TaskScheduler.UnobservedTaskException += OnUnobservedTaskException; + //多线程异常 + AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; + + 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) + { + // 注入日志 + XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config")); + //containerRegistry.RegisterInstance(LogManager.GetLogger("")); + + // 串口工具 + 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.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 调拨取药页面 + containerRegistry.RegisterForNavigation(); + // 调拨取药模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 抽屉取药页面 + containerRegistry.RegisterForNavigation(); + // 自选取药模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 自选取药页面 + containerRegistry.RegisterForNavigation(); + #endregion + + #region 加药 + // 自选加药页面 + containerRegistry.RegisterForNavigation(); + // 调拨加药页面 + containerRegistry.RegisterForNavigation(); + + // 调拨取药模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 抽屉加药页面 + containerRegistry.RegisterForNavigation(); + // 自选加药模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + #endregion + + #region 还药 + // 还药页面 + containerRegistry.RegisterForNavigation(); + // 按记录归还药品模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + + // 还药页面2 + containerRegistry.RegisterForNavigation(); + // 按处方归还药品模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 还空瓶页面 + containerRegistry.RegisterForNavigation(); + // 归还空瓶模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + #endregion + + #region 库存管理 + // 库存列表页面 + containerRegistry.RegisterForNavigation(); + // 库位绑定模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 库存列表页面 + containerRegistry.RegisterForNavigation(); + // 药品列表页面 + // containerRegistry.RegisterForNavigation(); + + #endregion + + #region 系统设置 + // 用户管理页面 + containerRegistry.RegisterForNavigation(); + // 编辑用户模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 角色管理页面 + containerRegistry.RegisterForNavigation(); + // 系统设置 + containerRegistry.RegisterForNavigation(); + // 调试页面 + containerRegistry.RegisterForNavigation(); + + #endregion + + // 设备记录页面 + containerRegistry.RegisterForNavigation(); + + containerRegistry.RegisterForNavigation(); + + } + } +} 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/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 @@ + + + + + + +