using DataEntity.Share;
using System;
using System.Collections.ObjectModel;
using System.Data;
using System.Windows;
using System.Windows.Media;
using System.Xml;
using XCommon.Log;
using XHandler.Class;
using XHandler.Class.DataEx;
using XHandler.View.ManualCoating;
namespace XHandler.View.ManualPick
{
///
/// 挑菌后继续页面
///
public partial class ConfirmNext : Window
{
public event EventHandler closeEvent;
public event EventHandler okEvent;
public ManualPickBacteria manualPickBacteria = null;
public RunWnd launchView;
public XmlNode methodNode;
public DataTable dtChoiceParams;
public bool cancelFlg = false;
public ObservableCollection dgBacteriaCoordinates = null;
public ConfirmNext()
{
InitializeComponent();
this.Owner = (Window)Shared.Main;
}
private void Button_Click(object sender, RoutedEventArgs e)
{
if (EventResponseController.Instance.CanExecute() == false)
return;
cancelFlg = true;
closeEvent?.Invoke(this, EventArgs.Empty);
}
private void btnConfirm_Click(object sender, RoutedEventArgs e)
{
if (radiobtnDoNext.IsChecked == true)
{
ConfirmNext_okEvent();
}
else if (radiobtnCancel.IsChecked == true)
{
cancelFlg = true;
}
this.Close();
}
///
/// 执行下一个命令
///
public void ConfirmNext_okEvent()
{
try
{
if (manualPickBacteria != null)
{
this.Close();
CoatingSetting coatingSetting = new CoatingSetting();
coatingSetting.Height = this.ActualHeight;
coatingSetting.Width = this.ActualWidth;
coatingSetting.launchView = launchView;
coatingSetting.methodNode = methodNode;
coatingSetting.dtChoiceParams = dtChoiceParams;
SolidColorBrush mybtn1_Brush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0));
coatingSetting.Background = (System.Windows.Media.Brush)mybtn1_Brush;
coatingSetting.dgBacteriaCoordinates = dgBacteriaCoordinates;
coatingSetting.ShowDialog();
}
}
catch (Exception ex)
{
LoggerHelper.ErrorLog("ERROR:", ex);
}
}
private void Window_Load(object sender, RoutedEventArgs e)
{
// 1:人工挑选菌落;0:成像系统自动挑选菌落
string choicemode = dtChoiceParams.Rows[9]["属性值"].ToString();
if (choicemode.Equals("0"))
{
btnConfirm_Click(null, null);
}
}
}
}