From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点

---
 HMI.UI/RequirePasswordByUser.xaml.cs |   62 +++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/HMI.UI/RequirePasswordByUser.xaml.cs b/HMI.UI/RequirePasswordByUser.xaml.cs
new file mode 100644
index 0000000..598cad0
--- /dev/null
+++ b/HMI.UI/RequirePasswordByUser.xaml.cs
@@ -0,0 +1,62 @@
+锘縰sing HMI.Core.Entity;
+using HMI.Core.Util;
+using HMI.UI.Util;
+using Panuon.WPF.UI;
+using System.ComponentModel;
+
+namespace HMI.Base
+{
+    /// <summary>
+    /// RequirePasswordWindow.xaml 鐨勪氦浜掗�昏緫
+    /// </summary>
+    public partial class RequirePasswordByUser : WindowX
+    {
+        public RequirePasswordByUser(string username)
+        {
+            this.Username = username;
+            this.DataContext = this;
+            InitializeComponent();
+        }
+
+        private string username;
+        public string Username
+        {
+            get => username;
+            set
+            {
+                Set(ref username, value);
+            }
+        }
+
+        protected override void OnClosing(CancelEventArgs e)
+        {
+            //Press Continue Button
+            if (DialogResult == true)
+            {
+                try
+                {
+                    using (var helper = new Sqlite3Helper(PathHelper.DatabasePath))
+                    {
+                        if (!helper.HasData($"SELECT 1 FROM user WHERE username = '{Username}' AND password = '{PwdPassword.Password}';"))
+                        {
+                            ToastHelper.Error(this, "瀵嗙爜閿欒");
+                            e.Cancel = true;
+                        }
+                    }
+                }
+                catch (System.Exception ex)
+                {
+                    ToastHelper.Error(this, $"楠岃瘉鐢ㄦ埛淇℃伅澶辫触: {ex.Message}");
+                    e.Cancel = true;
+                }
+            }
+            base.OnClosing(e);
+        }
+
+        private void WindowX_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            Username = UserInfo.User.Username;
+            PwdPassword.Password = string.Empty;
+        }
+    }
+}

--
Gitblit v1.9.1