1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System;
- using System.Drawing;
- using System.IO;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using Venus_MainPages.Roles;
- using Venus_MainPages.Unity;
- using WPF.Themes.UserControls;
- namespace Venus_MainPages.Views
- {
- /// <summary>
- /// LoginView.xaml 的交互逻辑
- /// </summary>
- public partial class LogoutView : Window
- {
- public LogoutView()
- {
- InitializeComponent();
- userTextBlock.Text = GlobalUser.Instance.User.Name;
- passwordTextBlock.Text = "******";
- roleTextBlock.Text= GlobalUser.Instance.User.Role.ToString();
- }
- private void Close_Click(object sender, RoutedEventArgs e)
- {
- this.Close();
- }
- private void Login_Click(object sender, RoutedEventArgs e)
- {
- Logout();
- }
- private void PassWordTextBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.Key == Key.Return)
- {
- Logout();
- }
- }
-
- private void Logout()
- {
- //if (UserTextBox.Text != "admin")
- //{
- // IsLoginSuccess = false;
- // WPFMessageBox.ShowError("用户名错误");
- // return;
- //}
- //if (PassWordTextBox.Password != "admin")
- //{
- // IsLoginSuccess = false;
- // WPFMessageBox.ShowError("密码错误");
- // return;
- //}
- Environment.Exit(0); // 0 表示正常退出
- }
- private void Window_Closed(object sender, EventArgs e)
- {
- this.Closed -= Window_Closed;
- this.logButton.Click -= Login_Click;
- this.closeButton.Click -= Close_Click;
- }
- }
- }
|