diff --git a/Login.xaml.cs b/Login.xaml.cs
index cf759e4..46c416b 100644
--- a/Login.xaml.cs
+++ b/Login.xaml.cs
@@ -69,13 +69,13 @@ namespace formula_manage
string user = User.Text;
string pasword = Pasword.Password; ;
- if (User.Text == "")
+ if (User.Text == "") //检查用户名输入
{
System.Windows.MessageBox.Show("请输入用户名");
return;
}
- if ((user == "engineer" || user == "ENGINEER") && (pasword == "engineer" || pasword == "ENGINEER"))
+ if ((user == "engineer" || user == "ENGINEER") && (pasword == "engineer" || pasword == "ENGINEER")) //确认账号是否是工程师
{
App.USER_Purview = "ENGINEER";//传入用户名
@@ -88,10 +88,10 @@ namespace formula_manage
{
string var_sql;
- if (pasword =="") var_sql = "[UserCode]='" + user + "' and [PassWord] is null";
+ if (pasword =="") var_sql = "[UserCode]='" + user + "' and [PassWord] is null"; //查询字符
else var_sql = "[UserCode]='" + user + "' and [PassWord]='" + pasword + "'";
- var loginOK = this.logindataTable.Select(var_sql).FirstOrDefault();
+ var loginOK = this.logindataTable.Select(var_sql).FirstOrDefault(); //查询账号信息是否正确,不正确返回null
if (loginOK != null)
{
@@ -208,7 +208,7 @@ namespace formula_manage
if (DISPENLINK.Background == Brushes.Green)
{
- string user_sql = "SELECT UserCode ,PassWord ,UserSetup ,Capacity ,GROUP_CODE ,Note FROM [Dispensing].[dbo].[UserAccount]";//查询语句
+ string user_sql = "SELECT UserCode ,PassWord ,UserSetup ,Capacity ,GROUP_CODE ,Note FROM [Dispensing].[dbo].[UserAccount] WHERE Capacity != 0";//查询语句
try
{
diff --git a/Windows/User.xaml b/Windows/User.xaml
index d7edc93..ddc78f3 100644
--- a/Windows/User.xaml
+++ b/Windows/User.xaml
@@ -63,7 +63,7 @@
-
diff --git a/Windows/User.xaml.cs b/Windows/User.xaml.cs
index da9ae84..261268e 100644
--- a/Windows/User.xaml.cs
+++ b/Windows/User.xaml.cs
@@ -125,6 +125,8 @@ namespace formula_manage.Windows
Capacity.Text = (DataGriduser.Columns[2].GetCellContent(DataGriduser.Items[rownum]) as TextBlock).Text.Trim();
Note.Text = (DataGriduser.Columns[3].GetCellContent(DataGriduser.Items[rownum]) as TextBlock).Text.Trim();
}
+
+ Pasword.Text = null; //清除密码框
}
private async void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件