| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- using ivf_tl_Entity.Enums;
- using ivf_tl_Entity.Response;
- using ivf_tl_Manage.Converts;
- using ivf_tl_Manage.ViewModels;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection.Metadata;
- 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>
- /// ExportDishWindow.xaml 的交互逻辑
- /// </summary>
- public partial class ExportDishWindow : Window
- {
- ExportDishResponse exportDishResponse;
- public ExportDishWindow(ExportDishResponse exportDishResponse1)
- {
- InitializeComponent();
- exportDishResponse = exportDishResponse1;
- this.Owner = AppData.Instance.MainWindow;
- Closed += (s, e) => AppData.Instance.MainWindow.Activate();
- }
- private void MessageBoxShow(string mess)
- {
- this.message.Text = mess;
- }
- private void ExLog(Exception ex, string name)
- {
- AppData.Instance.LogService.ExceptionLog(ex, $"ExportDishWindow.{name}", LogEnum.RunException);
- }
- private void ErrorLog(string message, LogEnum logType)
- {
- AppData.Instance.LogService.TLLog($"ExportDishWindow.{message}", logType);
- }
- private void Cancel_MouseUp(object sender, MouseButtonEventArgs e)
- {
- this.DialogResult = false;
- return;
- }
- private void Ok_Click(object sender, RoutedEventArgs e)
- {
- if (this._rem_CheckBox1.IsChecked == false &&
- this._len_CheckBox1.IsChecked == false &&
- this._fei_CheckBox1.IsChecked == false &&
- this._san_CheckBox1.IsChecked == false &&
- this._wei_CheckBox1.IsChecked == false)
- {
- MessageBoxShow("至少选择一个去向");
- return;
- }
- string dirName = this._dirName_TextBox.Text.Trim();
- if (string.IsNullOrEmpty(dirName))
- {
- MessageBoxShow(KeyToStringConvert.GetLanguageStringByKey("0618"));
- return;
- }
- exportDishResponse.tlSn = dirName;
- if (this._rem_CheckBox1.IsChecked == true) exportDishResponse.transplant = true;
- if (this._len_CheckBox1.IsChecked == true) exportDishResponse.freezing = true;
- if (this._fei_CheckBox1.IsChecked == true) exportDishResponse.invalid = true;
- if (this._san_CheckBox1.IsChecked == true) exportDishResponse.deleted = true;
- if (this._wei_CheckBox1.IsChecked == true) exportDishResponse.unmark = true;
- this.DialogResult = true;
- return;
- }
- private void Cancel_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = false;
- return;
- }
- private void SelectDir_Click(object sender, RoutedEventArgs e)
- {
- var dialog = new System.Windows.Forms.FolderBrowserDialog();
- if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- this._dirName_TextBox.Text = dialog.SelectedPath;
- }
- }
- bool isChildren = false;
- private void setParent(bool b)
- {
- if (!b)
- {
- isChildren = true;
- this._all_CheckBox1.IsChecked = b;
- isChildren = false;
- return;
- }
- if (this._rem_CheckBox1.IsChecked == b &&
- this._len_CheckBox1.IsChecked == b &&
- this._fei_CheckBox1.IsChecked == b &&
- this._san_CheckBox1.IsChecked == b &&
- this._wei_CheckBox1.IsChecked == b)
- {
- isChildren = true;
- this._all_CheckBox1.IsChecked = b;
- isChildren = false;
- }
- return;
- }
- private void SetChildren(bool b)
- {
- this._rem_CheckBox1.IsChecked = b;
- this._len_CheckBox1.IsChecked = b;
- this._fei_CheckBox1.IsChecked = b;
- this._san_CheckBox1.IsChecked = b;
- this._wei_CheckBox1.IsChecked = b;
- }
- private void All_UnChecked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._all_CheckBox1.IsLoaded || isChildren) return;
- SetChildren(false);
- }
- private void All_Checked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._all_CheckBox1.IsLoaded || isChildren) return;
- SetChildren(true);
- }
- private void Rem_Checked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._rem_CheckBox1.IsLoaded) return;
- setParent(true);
- }
- private void Rem_UnChecked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._rem_CheckBox1.IsLoaded) return;
- setParent(false);
- }
- private void Len_Checked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._len_CheckBox1.IsLoaded) return;
- setParent(true);
- }
- private void Len_UnChecked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._len_CheckBox1.IsLoaded) return;
- setParent(false);
- }
- private void Fei_Checked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._fei_CheckBox1.IsLoaded) return;
- setParent(true);
- }
- private void Fei_UnChecked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._fei_CheckBox1.IsLoaded) return;
- setParent(false);
- }
- private void San_UnChecked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._san_CheckBox1.IsLoaded) return;
- setParent(false);
- }
- private void San_Checked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._san_CheckBox1.IsLoaded) return;
- setParent(true);
- }
- private void Wei_UnChecked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._wei_CheckBox1.IsLoaded) return;
- setParent(false);
- }
- private void Wei_Checked(object sender, RoutedEventArgs e)
- {
- if (!this.IsLoaded || !this._wei_CheckBox1.IsLoaded) return;
- setParent(true);
- }
- }
- }
|