| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using ivf_tl_Manage.Converts;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- 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 ivf_tl_Manage.Win
- {
- /// <summary>
- /// SafeWindow.xaml 的交互逻辑
- /// </summary>
- public partial class SafeWindow : Window
- {
- public SafeWindow(Window parent)
- {
- InitializeComponent();
- this.Owner = parent;
- this.Closed += (a, b) => parent.Activate();
- }
- private void Cancel_MouseUp(object sender, MouseButtonEventArgs e)
- {
- this.DialogResult = false; this.Close();
- }
- private void Cancel_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = false; this.Close();
- }
- private void Ok_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- var a = this._PasswordBox.Password;
- if (string.IsNullOrEmpty(a))
- {
- //this.message.Text = "请输入验证密码";
- this.message.Text = KeyToStringConvert.GetLanguageStringByKey("0280");
- return;
- }
- if(a == AppData.Instance.TLPassWord)
- {
- this.DialogResult = true;
- this.Close();
- return;
- }
- //this.message.Text = "验证密码输入错误";
- this.message.Text = KeyToStringConvert.GetLanguageStringByKey("0287");
- }
- catch (Exception ex)
- {
- //this.message.Text = $"操作失败:{ex.Message}";
- this.message.Text = $"{KeyToStringConvert.GetLanguageStringByKey("0286")}:{ex.Message}";
- }
- }
- private void PasswordBox_Old_Click(object sender, RoutedEventArgs e)
- {
- if (!(sender is PasswordBox source)) return;
- source.Password = "";
- }
- }
- }
|