diff --git a/ConvertMoels/StatenClassConvert.cs b/ConvertMoels/StatenClassConvert.cs
index 33c240e..9460b1a 100644
--- a/ConvertMoels/StatenClassConvert.cs
+++ b/ConvertMoels/StatenClassConvert.cs
@@ -20,7 +20,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ConvertMoels
string Staten = null;
string i = value.ToString();
- if (i == "100") Staten = Properties.Resources.Await;//等待
+ if (i == "100") Staten = Properties.Resources.NotSent;//等待
else if (i == "101") Staten = Properties.Resources.Ready;//准备
else if (i == "102") Staten = Properties.Resources.Measure;//计量
else if (i == "109") Staten = Properties.Resources.ERR;//错误
diff --git a/SunlightCentralizedControlManagement_SCCM_.csproj b/SunlightCentralizedControlManagement_SCCM_.csproj
index c5f00aa..b19a993 100644
--- a/SunlightCentralizedControlManagement_SCCM_.csproj
+++ b/SunlightCentralizedControlManagement_SCCM_.csproj
@@ -136,6 +136,9 @@
MachinesView.xaml
+
+ DyeingPlanView.xaml
+
ProductionPlanningEdit.xaml
@@ -227,6 +230,10 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
Designer
MSBuild:Compile
diff --git a/View/DyeingPlanView.xaml b/View/DyeingPlanView.xaml
new file mode 100644
index 0000000..44a3515
--- /dev/null
+++ b/View/DyeingPlanView.xaml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/View/DyeingPlanView.xaml.cs b/View/DyeingPlanView.xaml.cs
new file mode 100644
index 0000000..a3f7920
--- /dev/null
+++ b/View/DyeingPlanView.xaml.cs
@@ -0,0 +1,358 @@
+using Newtonsoft.Json.Linq;
+using nGantt.GanttChart;
+using SunlightCentralizedControlManagement_SCCM_.UserClass;
+using SunlightCentralizedControlManagement_SCCM_.ViewModel;
+using SunlightCentralizedControlManagement_SCCM_.WindowsView;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+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.Navigation;
+using System.Windows.Shapes;
+using System.Xml.Linq;
+using TouchSocket.Core;
+using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
+using static SunlightCentralizedControlManagement_SCCM_.WindowsView.ViewStep;
+using static System.Windows.Forms.AxHost;
+
+namespace SunlightCentralizedControlManagement_SCCM_.View
+{
+ ///
+ /// ProductionPlanningEdit.xaml 的交互逻辑
+ ///
+ public partial class DyeingPlanView : UserControl
+ {
+ private SQLiteHelper SQLiteHelpers = null; //定义数据库
+ private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
+ DataTable ProgramName = new DataTable();
+ DataTable WorkOrder =new DataTable();
+ DataTable dat = new DataTable();
+ public string WorkOrder_n;
+ public DyeingPlanView()
+ {
+ InitializeComponent();
+ SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
+ SQLiteHelpers.Open(); //打开数据库
+ ProgramName = SQLiteHelpers.ExecuteDataSet("select * from ProgramName order by ProgramID desc", null).Tables[0];//缓存
+ SQLiteHelpers.Close(); //关闭连接
+ comboBoxMachine.ItemsSource = MainWindowViewModel.Machines.AsEnumerable().Select(rowdata => rowdata.Field("name")).ToList();//转换机台
+ comboBoxProgram.ItemsSource = ProgramName.AsEnumerable().Select(rowdata => rowdata.Field("ProgramName")).ToList();//转换工艺代码
+
+
+ }
+ private void UserControl_Loaded(object sender, RoutedEventArgs e)
+ {
+
+ }
+ private void comboBoxMachine_DropDownClosed(object sender, EventArgs e)//机台选择
+ {
+ string[] sArray = Regex.Split(comboBoxMachine.Text, @"\+", RegexOptions.IgnoreCase);
+ if (sArray.Length <= 1)
+ {
+ comboBoxDyelot.IsEnabled = true;
+ SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
+ SQLiteHelpers.Open(); //打开数据库
+ DataTable DatDyelot = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where Machine='" + comboBoxMachine.Text + "' and State='101' order by Dyelot desc", null).Tables[0]; //读取计划表写入缓存
+ SQLiteHelpers.Close(); //关闭连接
+ comboBoxDyelot.ItemsSource = DatDyelot.AsEnumerable().Select(rowdata => rowdata.Field("Dyelot")).ToList();//转换代码
+ }
+ }
+ private void Multi_Click(object sender, RoutedEventArgs e)//机台组
+ {
+ MachineSelection machineSelection = new MachineSelection();
+ machineSelection.AddressUpdated += new MachineSelection.AddressUpdateHandler(Address_Multi_Click);
+ //machineSelection.data = "ID";
+ machineSelection.ShowDialog();
+ }
+ private void Address_Multi_Click(object sender, MachineSelection.AddressUpdateEventArgs e)//机台组返回结果
+ {
+ if(!string.IsNullOrEmpty(e.Groups)) comboBoxMachine.Text = e.Groups;
+ comboBoxDyelot.Text = null;
+ comboBoxDyelot.IsEnabled = false;
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)//保存按钮
+ {
+ if (string.IsNullOrEmpty(comboBoxMachine.Text))
+ {
+ MessageBox.Show("Not Machine", "SCCM", MessageBoxButton.OK, MessageBoxImage.Question);
+ return;
+ }
+ if (string.IsNullOrEmpty(comboBoxProgram.Text))
+ {
+ MessageBox.Show("Not Program", "SCCM", MessageBoxButton.OK, MessageBoxImage.Question);
+ return;
+ }
+ string[] pArray = Regex.Split(comboBoxProgram.Text, @"\+", RegexOptions.IgnoreCase);
+
+
+ //单机器信息写入
+ string sTime;
+ string StartTime_;
+ string WorkOrder_ = comboBoxMachine.Text + "_" + DateTime.Now.ToString("yyMMddHHmmss");
+ if (!string.IsNullOrEmpty(WorkOrder_n)) WorkOrder_ = WorkOrder_n;
+ string ProgramName_ = comboBoxProgram.Text;
+ string ProgramID_ = null;
+ for (int j = 0; j < pArray.Length; j++)
+ {
+ try
+ {
+ if (j == 0)
+ {
+ ProgramID_ = ProgramName.Select("ProgramName='" + pArray[j] + "'").
+ First().Field