账号是否启用管理
This commit is contained in:
commit
06d048ad85
2 files changed
+7
-5
No files matched your search
+5
-5
@@ -69,13 +69,13 @@ namespace formula_manage
|
|||||||
string user = User.Text;
|
string user = User.Text;
|
||||||
string pasword = Pasword.Password; ;
|
string pasword = Pasword.Password; ;
|
||||||
|
|
||||||
if (User.Text == "")
|
if (User.Text == "") //检查用户名输入
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show("请输入用户名");
|
System.Windows.MessageBox.Show("请输入用户名");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((user == "engineer" || user == "ENGINEER") && (pasword == "engineer" || pasword == "ENGINEER"))
|
if ((user == "engineer" || user == "ENGINEER") && (pasword == "engineer" || pasword == "ENGINEER")) //确认账号是否是工程师
|
||||||
{
|
{
|
||||||
App.USER_Purview = "ENGINEER";//传入用户名
|
App.USER_Purview = "ENGINEER";//传入用户名
|
||||||
|
|
||||||
@@ -88,10 +88,10 @@ namespace formula_manage
|
|||||||
{
|
{
|
||||||
string var_sql;
|
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 + "'";
|
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)
|
if (loginOK != null)
|
||||||
{
|
{
|
||||||
@@ -208,7 +208,7 @@ namespace formula_manage
|
|||||||
|
|
||||||
if (DISPENLINK.Background == Brushes.Green)
|
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
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -125,6 +125,8 @@ namespace formula_manage.Windows
|
|||||||
Capacity.Text = (DataGriduser.Columns[2].GetCellContent(DataGriduser.Items[rownum]) as TextBlock).Text.Trim();
|
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();
|
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)//保存按钮事件
|
private async void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件
|
||||||
|
|||||||
Reference in new issue
Block a user