This commit is contained in:
sc authored and sc committed 2022-01-25 16:27:42 +08:00
commit 7db3c62905
3 files changed
+24 -9

No files matched your search

+18 -7
View File
@@ -38,9 +38,9 @@ namespace Audit.Windows
string users = this.users.Text;
string Passwds = this.Passwds.Text;
if (users == "sunlight")
if (users == "sunlight")//内置账号
{
if (Passwds == "sunlight")
if (Passwds == "setup")//设置页面判断
{
MessageBox.Show("警告:进入设置模式请您明确操作目的及可能需承担的后果");
Windows.Set_up setup = new Windows.Set_up();
@@ -49,21 +49,32 @@ namespace Audit.Windows
}
else
{
MessageBox.Show("ERR.C0011:拒绝登录");//设置密码错误
if (Passwds == "sunlight")//主页面判断
{
MessageBox.Show("SC:开启主页面");
MainWindow mainWindow = new MainWindow();
mainWindow.Show();//实例化并打开主窗口
this.Close();//关闭当前窗口
}
else
{
MessageBox.Show("ERR.C0011:拒绝登录");//设置密码错误
}
}
}
else
{
UserAccountProvide UserAccountProvide = new UserAccountProvide();
var usersql = UserAccountProvide.Select().FirstOrDefault(item => item.UserCode == users && item.PassWord == Passwds);
if (usersql == null)
UserAccountProvide UserAccountProvide = new UserAccountProvide();//实例化数据库用户表
var usersql = UserAccountProvide.Select().FirstOrDefault(item => item.UserCode == users && item.PassWord == Passwds);//查询比较用户信息
if (usersql == null)//判断查询结果
{
MessageBox.Show("ERR.C0000:用户名或密码错误");
}
else
{
MainWindow mainWindow = new MainWindow();
mainWindow.Show();
mainWindow.Show();//实例化并打开主窗口
this.Close();//关闭当前窗口
}