From 64fc752794b8bdb846f7af17c7722955363a2a8b Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期二, 23 七月 2024 10:13:45 +0800
Subject: [PATCH] 增加临时登录表

---
 Desktop/HStation.DeskTop.Xhs.Main/Login/LoginFrm.cs |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/Desktop/HStation.DeskTop.Xhs.Main/Login/LoginFrm.cs b/Desktop/HStation.DeskTop.Xhs.Main/Login/LoginFrm.cs
index 6e0768f..f1f58fe 100644
--- a/Desktop/HStation.DeskTop.Xhs.Main/Login/LoginFrm.cs
+++ b/Desktop/HStation.DeskTop.Xhs.Main/Login/LoginFrm.cs
@@ -9,6 +9,8 @@
 using System.Windows.Forms;
 using System.Configuration;
 using DevExpress.XtraEditors;
+using DevExpress.XtraEditors.Internal;
+using HStation.WinFrmUI;
 
 namespace HStation.Desktop
 {
@@ -47,7 +49,7 @@
 
         private void btnLogin_Click(object sender, EventArgs e)
         {
-            Login();
+            LocalLogin();
         }
 
         /// <summary>
@@ -106,7 +108,7 @@
             }
         }
 
-        //鐧诲綍
+        //鐧诲綍  (杩滅▼鐧诲綍)
         private async void Login()
         {
             if (!Valid())
@@ -142,5 +144,30 @@
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
+
+        //鏈湴鐧诲綍
+        private async void LocalLogin()
+        {
+            if (!Valid())
+                return;
+            var bll = new BLL.LoginUserMain();
+            var alluser = await bll.GetAll();
+            bool found = false;
+            foreach (var item in alluser)
+            {
+                if (item.LoginName == this.txtLoginName.Text.Trim() && item.PassWord == this.txtPwd.Text.Trim())
+                {
+                    this.DialogResult = DialogResult.OK;
+                    this.Close();
+                    found = true;
+                    break;
+                }
+            }
+            if (!found)
+            {
+                MessageBoxHelper.ShowError("鐧诲綍澶辫触");
+                this.itemForProgress.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3