账号是否启用管理
This commit is contained in:
commit
06d048ad85
3 files changed
+8
-6
No files matched your search
+5
-5
@@ -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
|
||||
{
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<!--名-->
|
||||
<TextBox x:Name="_Name" HorizontalAlignment="Left" Height="30" Margin="105,0,0,100" Text=" "
|
||||
<TextBox x:Name="_Name" HorizontalAlignment="Left" Height="30" Margin="105,0,0,100" Text=""
|
||||
VerticalAlignment="Bottom" Width="250" FontSize="22" MaxLines="1" MaxLength="50" />
|
||||
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,100" TextWrapping="Wrap" Text="用户名"
|
||||
VerticalAlignment="Bottom" Width="85" FontSize="20"/>
|
||||
|
||||
@@ -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)//保存按钮事件
|
||||
|
||||
Reference in new issue
Block a user