Shuxia Ning
2024-09-26 502ed6f01f605098d46a1fe9f55f416d5c5c3e13
Desktop/HStation.DeskTop.Xhs.Main/Login/LoginFrm.cs
@@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using DevExpress.XtraEditors;
using System;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;
using DevExpress.XtraEditors;
using HStation.WinFrmUI;
namespace HStation.Desktop
{
@@ -106,7 +104,7 @@
            }
        }
        //登录
        //登录  (远程登录)
        private async void Login()
        {
            if (!Valid())
@@ -138,9 +136,34 @@
            }
            settings.Save();
            var login = new LoginUser(result);
            var login = new GlobalParas(result);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        //本地登录
        private async void LocalLogin()
        {
            if (!Valid())
                return;
            var bll = new BLL.UserLoginAccount();
            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)
            {
                WinFrmUI.MessageBoxHelper.ShowError("登录失败");
                this.itemForProgress.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            }
        }
    }
}