|
@@ -1,21 +1,7 @@
|
|
|
-using Aitex.Core.Account;
|
|
|
-using MECF.Framework.UI.Core.Accounts;
|
|
|
-using Prism.Ioc;
|
|
|
-using Prism.Regions;
|
|
|
-using System;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.Linq;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
+using System;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
-using System.Windows.Data;
|
|
|
-using System.Windows.Documents;
|
|
|
using System.Windows.Input;
|
|
|
-using System.Windows.Media;
|
|
|
-using System.Windows.Media.Imaging;
|
|
|
-using System.Windows.Navigation;
|
|
|
-using System.Windows.Shapes;
|
|
|
using Venus_MainPages.Roles;
|
|
|
using WPF.Themes.UserControls;
|
|
|
|
|
@@ -41,6 +27,25 @@ namespace Venus_MainPages.Views
|
|
|
}
|
|
|
private void Login_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
+ Login();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void PassWordTextBox_KeyDown(object sender, KeyEventArgs e)
|
|
|
+ {
|
|
|
+ if (e.Key == Key.Return)
|
|
|
+ {
|
|
|
+ Login();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void UserTextBox_KeyDown(object sender, KeyEventArgs e)
|
|
|
+ {
|
|
|
+ if (e.Key == Key.Return)
|
|
|
+ {
|
|
|
+ PassWordTextBox.Focus();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void Login()
|
|
|
+ {
|
|
|
IsLoginSuccess = true;
|
|
|
if (UserTextBox.Text != "admin")
|
|
|
{
|
|
@@ -55,7 +60,8 @@ namespace Venus_MainPages.Views
|
|
|
return;
|
|
|
}
|
|
|
CurrentUser = new User(UserTextBox.Text, PassWordTextBox.Password, (Role)Enum.Parse(typeof(Role), (MangerComboBox.SelectedItem as ComboBoxItem).Content.ToString(), true));
|
|
|
- this.Close();
|
|
|
+ this.Visibility = Visibility.Hidden;
|
|
|
+ //this.Close();
|
|
|
}
|
|
|
}
|
|
|
}
|