From d7be195b0e1949c7b38bce2ad83ae974cbfac094 Mon Sep 17 00:00:00 2001 From: chr <chr@mailcom> Date: 星期三, 04 九月 2024 13:58:54 +0800 Subject: [PATCH] 优化图纸审核备注的图片上传; --- PdmAlert/LoginWindow.xaml.cs | 54 +++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 43 insertions(+), 11 deletions(-) diff --git a/PdmAlert/LoginWindow.xaml.cs b/PdmAlert/LoginWindow.xaml.cs index 99cd421..0dde24c 100644 --- a/PdmAlert/LoginWindow.xaml.cs +++ b/PdmAlert/LoginWindow.xaml.cs @@ -1,16 +1,7 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +锘縰sing PdmAlert.Util; +using System; using System.Threading.Tasks; 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.Shapes; namespace PdmAlert { @@ -21,7 +12,48 @@ { public LoginWindow() { + _windowTitle = $"V{App.Version}"; + DataContext = this; InitializeComponent(); } + + private string _windowTitle; + + public string windowTitle + { + get => _windowTitle; + } + + + public void Button_Click(object sender, RoutedEventArgs e) + { + MaskAdorner.ShowMask(mainBorder); + string username = usernameTextBlock.Text; + string password = passwordTextBlock.Password; + bool rememberMe = rememberMeInput.IsChecked == true; + Task.Run(() => + { + try + { + if (LoginUser.Login(username, password, rememberMe)) + { + Dispatcher.Invoke(() => + { + ((App)Application.Current).InitDockApp(); + this.Close(); + }); + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "鐧诲綍寮傚父", MessageBoxButton.OK, MessageBoxImage.Error); + } + finally + { + MaskAdorner.HideMask(mainBorder); + } + }); + + } } } -- Gitblit v1.9.1