diff --git a/MainWindow.xaml b/MainWindow.xaml index f0f4f42..24d7d58 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -8,4 +8,8 @@ xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" x:Class="Audit.MainWindow" mc:Ignorable="d" - Title="化学品审计管理" Height="1080" Width="1920" WindowStartupLocation="CenterScreen"/> + Title="化学品审计管理" Height="720" Width="960" WindowStartupLocation="CenterScreen"> + + + + \ No newline at end of file diff --git a/Models/SQL_Ti.edmx.diagram b/Models/SQL_Ti.edmx.diagram index 98778d4..be1d1bc 100644 --- a/Models/SQL_Ti.edmx.diagram +++ b/Models/SQL_Ti.edmx.diagram @@ -4,7 +4,7 @@ - + diff --git a/Windows/LogWindow.xaml.cs b/Windows/LogWindow.xaml.cs index 0d98076..1b4ea45 100644 --- a/Windows/LogWindow.xaml.cs +++ b/Windows/LogWindow.xaml.cs @@ -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();//关闭当前窗口 }