diff --git a/DATA/SCCM.db b/DATA/SCCM.db
index ad1c11a..bd17d1b 100644
Binary files a/DATA/SCCM.db and b/DATA/SCCM.db differ
diff --git a/DATA/nGantt.zip b/DATA/nGantt.zip
index 15581be..a2845b0 100644
Binary files a/DATA/nGantt.zip and b/DATA/nGantt.zip differ
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
index b726596..4acbb6d 100644
--- a/Properties/Resources.Designer.cs
+++ b/Properties/Resources.Designer.cs
@@ -1122,6 +1122,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
+ ///
+ /// 查找类似 LinkDispenser 的本地化字符串。
+ ///
+ public static string LinkDispenser {
+ get {
+ return ResourceManager.GetString("LinkDispenser", resourceCulture);
+ }
+ }
+
///
/// 查找类似 LnsufficientPower 的本地化字符串。
///
@@ -2454,6 +2463,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
+ ///
+ /// 查找类似 The picking list has been used 的本地化字符串。
+ ///
+ public static string TPLHBU {
+ get {
+ return ResourceManager.GetString("TPLHBU", resourceCulture);
+ }
+ }
+
///
/// 查找类似 trce 的本地化字符串。
///
@@ -2463,6 +2481,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
+ ///
+ /// 查找类似 The ticket already exists 的本地化字符串。
+ ///
+ public static string TTAE {
+ get {
+ return ResourceManager.GetString("TTAE", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Type 的本地化字符串。
///
diff --git a/Properties/Resources.en-US.resx b/Properties/Resources.en-US.resx
index 6924b8b..a1e037d 100644
--- a/Properties/Resources.en-US.resx
+++ b/Properties/Resources.en-US.resx
@@ -981,4 +981,13 @@
Details Were Not Sent
+
+ Link Dispenser
+
+
+ The picking list has been used
+
+
+ The ticket already exists
+
\ No newline at end of file
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
index 3f96816..7fef75f 100644
--- a/Properties/Resources.resx
+++ b/Properties/Resources.resx
@@ -981,4 +981,13 @@
Details were not sent
+
+ LinkDispenser
+
+
+ The picking list has been used
+
+
+ The ticket already exists
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx
index 869f3cc..b7c680a 100644
--- a/Properties/Resources.zh-CN.resx
+++ b/Properties/Resources.zh-CN.resx
@@ -981,4 +981,13 @@
未发送明细
+
+ 连接染料助剂分配器
+
+
+ 领料单已使用
+
+
+ 工单已经存在
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-TW.resx b/Properties/Resources.zh-TW.resx
index 40371e1..f4b2bb1 100644
--- a/Properties/Resources.zh-TW.resx
+++ b/Properties/Resources.zh-TW.resx
@@ -981,4 +981,13 @@
未發送明細
+
+ 連接染料助劑分配器
+
+
+ 領料單已使用
+
+
+ 工單已經存在
+
\ No newline at end of file
diff --git a/View/DyeingPlanView.xaml b/View/DyeingPlanView.xaml
index ad4403c..7634315 100644
--- a/View/DyeingPlanView.xaml
+++ b/View/DyeingPlanView.xaml
@@ -14,7 +14,7 @@
+ FontSize="15" IsEditable="True" BorderBrush="#FF673AB7" KeyDown="comboBoxDyelot_KeyDown" />
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();
DataTable TEMPTable = new DataTable();
+ DataTable DyelotsBulkedRecipe=new DataTable();
public string WorkOrder_n;
public DyeingPlanView()
{
@@ -72,21 +73,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
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;
- }
-
- string color_ = "#FF336FA8";
private void Button_Click(object sender, RoutedEventArgs e)//保存按钮
{
if (string.IsNullOrEmpty(comboBoxMachine.Text))
@@ -211,6 +197,32 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
SQLiteHelpers.InsertData("WorkorderSteps", WorkOrder_DAT);//行插入
WorkOrder_DAT.Clear();
}
+ if (!String.IsNullOrEmpty(comboBoxDyelot.Text))//料单信息
+ {
+ for (int x = 0; x < DyelotsBulkedRecipe.Rows.Count; x++)
+ {
+ WorkOrder_DAT.Add("WorkOrder", comboBoxWorkOrder.Text);
+ WorkOrder_DAT.Add("Dyelot", DyelotsBulkedRecipe.Rows[x]["Dyelot"]);
+ WorkOrder_DAT.Add("Redye", DyelotsBulkedRecipe.Rows[x]["Redye"]);
+ WorkOrder_DAT.Add("Step", DyelotsBulkedRecipe.Rows[x]["StepNumber"]);
+ WorkOrder_DAT.Add("TIME", DyelotsBulkedRecipe.Rows[x]["Created"]);
+ WorkOrder_DAT.Add("Tank", DyelotsBulkedRecipe.Rows[x]["TankNo"]);
+ WorkOrder_DAT.Add("State", DyelotsBulkedRecipe.Rows[x]["DispenseResult"]);
+ WorkOrder_DAT.Add("Machine", comboBoxMachine.Text);
+ WorkOrder_DAT.Add("ProductCode", DyelotsBulkedRecipe.Rows[x]["ProductCode"]);
+ WorkOrder_DAT.Add("ProductName", DyelotsBulkedRecipe.Rows[x]["ProductName"]);
+ WorkOrder_DAT.Add("ProductType", DyelotsBulkedRecipe.Rows[x]["ProductType"]);
+ WorkOrder_DAT.Add("Grams", DyelotsBulkedRecipe.Rows[x]["Grams"]);
+ WorkOrder_DAT.Add("Amount", DyelotsBulkedRecipe.Rows[x]["Amount"]);
+ WorkOrder_DAT.Add("DispenseStartTime", DyelotsBulkedRecipe.Rows[x]["DispenseStartTime"]);
+ WorkOrder_DAT.Add("DispenseEndTime", DyelotsBulkedRecipe.Rows[x]["DispenseEndTime"]);
+ WorkOrder_DAT.Add("DispenseGrams", DyelotsBulkedRecipe.Rows[x]["DispenseGrams"]);
+ WorkOrder_DAT.Add("Dispense", DyelotsBulkedRecipe.Rows[x]["Dispenser"]);
+ WorkOrder_DAT.Add("UserAccount", DyelotsBulkedRecipe.Rows[x]["UserAccount"]);
+ SQLiteHelpers.InsertData("Dyelot", WorkOrder_DAT);//行插入
+ WorkOrder_DAT.Clear();
+ }
+ }
SQLiteHelpers.Close(); //关闭连接
LogGing.ExchangeDATA("Dyelot=" + comboBoxWorkOrder.Text + ";Machine=" + comboBoxMachine.Text +
@@ -248,7 +260,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
Grid_data.ItemsSource = dat.DefaultView;
}
}
-
private void comboBoxProgram_TextChanged(object sender, TextChangedEventArgs e)
{
dat.Clear();
@@ -260,6 +271,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
string[] sArray = Regex.Split(text, @"\+", RegexOptions.IgnoreCase);
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
+ /* if (!string.IsNullOrEmpty(WorkOrder_n))
+ {
+ dat = SQLiteHelpers.ExecuteDataSet(
+ "select * from WorkorderSteps where WorkOrder='" + WorkOrder_n + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
+ }//插入工单不为空时载入细节信息*/
for (int i = 0; i < sArray.Length; i++)
{
DataTable temp = SQLiteHelpers.ExecuteDataSet(
@@ -270,11 +286,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
dat.Rows.Add(drT.ItemArray);
}
}//以工艺名组合工艺细节
- if (!string.IsNullOrEmpty(WorkOrder_n))
- {
- dat = SQLiteHelpers.ExecuteDataSet(
- "select * from WorkorderSteps where WorkOrder='" + WorkOrder_n + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
- }//插入工单不为空时载入细节信息
+
SQLiteHelpers.Close(); //关闭连接
DatSteps(dat);
Grid_data.ItemsSource = dat.DefaultView;
@@ -395,7 +407,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}
Grid_data.ItemsSource = dat.DefaultView;
}
-
private void TEMP()
{
//处理计划温度图表
@@ -461,14 +472,26 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}
}
Picture.Content = new View.CurveTemp(TEMPTable);
- }
-
+ } //计划温度图表
private async void comboBoxWorkOrder_KeyDown(object sender, KeyEventArgs e)//工单输入
{
- if (e.Key == Key.Enter)
+ if (e.Key == Key.Enter && MainWindowViewModel.DyelotsDispenser)
{
+ SQLiteHelpers = new SQLiteHelper(DBAddress);
+ SQLiteHelpers.Open(); //打开数据库
+ int dat_c = SQLiteHelpers.ExecuteDataSet("select * from WorkOrder where WorkOrder = '" + comboBoxWorkOrder.Text + "'", null).Tables[0].Rows.Count;//缓存
+ SQLiteHelpers.Close();
+
+ if (dat_c > 0)//查询料单是否可用
+ {
+ comboBoxWorkOrder.Text = null;
+ MessageBox.Show(Properties.Resources.TTAE, "WorkOrder", MessageBoxButton.OK, MessageBoxImage.Information); //连接成功提示是否保存
+ return;
+ }
+
string Connstr_SC;
string DYELOTS_sql = "SELECT * FROM [dbo].[DYELOTS] WHERE Dyelot = '" + comboBoxWorkOrder.Text + "'";//单号查询语句
+ string DyelotsBulkedRecipe_sql = "SELECT * FROM [dbo].[DyelotsBulkedRecipe] WHERE Dyelot = '" + comboBoxWorkOrder.Text + "'";
try
{
if (MainWindowViewModel.SQMOD == "Windows Authentication")
@@ -482,9 +505,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
SqlConnection conn_SC = new SqlConnection(Connstr_SC);
await conn_SC.OpenAsync(); //连接数据库
SqlDataAdapter DYELOTS_data = new SqlDataAdapter(DYELOTS_sql, Connstr_SC); //查询
+ SqlDataAdapter DyelotsBulkedRecipe_ = new SqlDataAdapter(DyelotsBulkedRecipe_sql, Connstr_SC);
conn_SC.Close();
+ DyelotsBulkedRecipe_.Fill(DyelotsBulkedRecipe);
+
- DataTable ds = new DataTable();
+ DataTable ds = new DataTable();//载入信息
DYELOTS_data.Fill(ds);
TEXTColorNumber.Text = ds.AsEnumerable().Select(row => row.Field("ColorNo")).First();
TEXTColorName.Text = ds.AsEnumerable().Select(row => row.Field("ColorName")).First();
@@ -513,8 +539,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
string colorValue = string.Format("{0:X6}", ds.AsEnumerable().Select(row => row.Field("color")).First());//十进制RGB数值转十六进制六位RGB并补0位例“C0C0C0”
color.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(
"#FF" + colorValue.Substring(4, 2) + colorValue.Substring(2, 2) + colorValue.Substring(0, 2)));
- }
-
+ }
}
catch (Exception ex)
{
@@ -522,7 +547,77 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}
}
}
+ private async void comboBoxDyelot_KeyDown(object sender, KeyEventArgs e)//料单输入
+ {
+ if (e.Key == Key.Enter && MainWindowViewModel.DyelotsDispenser)
+ {
+ string Connstr_SC;
+ string DYELOTS_sql = "SELECT * FROM [dbo].[DYELOTS] WHERE Dyelot = '" + comboBoxDyelot.Text + "'";//单号查询语句
+ try
+ {
+ SQLiteHelpers = new SQLiteHelper(DBAddress);
+ SQLiteHelpers.Open(); //打开数据库
+ int dat_c = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where Dyelot = '" + comboBoxDyelot.Text + "'", null).Tables[0].Rows.Count;//缓存
+ SQLiteHelpers.Close();
+
+ if (dat_c > 0)//查询料单是否可用
+ {
+ comboBoxDyelot.Text = null;
+ MessageBox.Show(Properties.Resources.TPLHBU, "Dyelot", MessageBoxButton.OK, MessageBoxImage.Information); //连接成功提示是否保存
+ return;
+ }
+
+ if (MainWindowViewModel.SQMOD == "Windows Authentication")
+ {
+ Connstr_SC = "server=" + MainWindowViewModel.SQLIP + ";database=" + MainWindowViewModel.SQLNAME + ";Trusted_Connection=SSPI";
+ }
+ else
+ {
+ Connstr_SC = "server=" + MainWindowViewModel.SQLIP + ";database=" + MainWindowViewModel.SQLNAME + ";User ID=" + MainWindowViewModel.SQLUSER + ";Password=" + MainWindowViewModel.SQLPASWORD;
+ }
+ SqlConnection conn_SC = new SqlConnection(Connstr_SC);
+ await conn_SC.OpenAsync(); //连接数据库
+ SqlDataAdapter DYELOTS_data = new SqlDataAdapter(DYELOTS_sql, Connstr_SC); //查询
+ conn_SC.Close();
+
+ DataTable ds = new DataTable();//载入信息
+ DYELOTS_data.Fill(ds);
+ TEXTColorNumber.Text = ds.AsEnumerable().Select(row => row.Field("ColorNo")).First();
+ TEXTColorName.Text = ds.AsEnumerable().Select(row => row.Field("ColorName")).First();
+ TEXTClient.Text = ds.AsEnumerable().Select(row => row.Field("CustomerName")).First();
+ TEXTClothSpecies.Text = ds.AsEnumerable().Select(row => row.Field("FabricName")).First();
+ TEXTClothWeight.Text = ds.AsEnumerable().Select(row => row.Field("TotalWeight")).First().ToString();
+ TEXTBathRatio.Text = ds.AsEnumerable().Select(row => row.Field("LiquidRatio")).First();
+ TEXTTotal.Text = ds.AsEnumerable().Select(row => row.Field("TotalVolume")).First();
+ // comboBoxDyelot.Text = ds.AsEnumerable().Select(row => row.Field("Dyelot")).First();
+
+ string machine_ = ds.AsEnumerable().Select(row => row.Field("Machine")).First();//机台
+ if (MainWindowViewModel.Machines.Select("Name ='" + machine_ + "'").Length == 0)
+ {
+ comboBoxMachine.Text = null;
+ }
+ else
+ {
+ comboBoxMachine.Text = machine_;
+ }
+ string user_ = ds.AsEnumerable().Select(row => row.Field("UserAccount")).First();//用户名
+ if (!String.IsNullOrEmpty(user_)) TEXTUSER.Text = user_;
+ comboBoxProgram.Text = ds.AsEnumerable().Select(row => row.Field("Program")).First();
+ if (ds.AsEnumerable().Select(row => row.Field("color")).First() > 0)//颜色
+ {
+ string colorValue = string.Format("{0:X6}", ds.AsEnumerable().Select(row => row.Field("color")).First());//十进制RGB数值转十六进制六位RGB并补0位例“C0C0C0”
+ color.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(
+ "#FF" + colorValue.Substring(4, 2) + colorValue.Substring(2, 2) + colorValue.Substring(0, 2)));
+ }
+ }
+ catch (Exception ex)
+ {
+ LogGing.ERRDATA(ex);
+ }
+ }
+
+ }
private void Tb_KeyTEXTClothWeight(object sender, TextCompositionEventArgs e)//输入事件
{
Regex numbeRegex = new Regex("^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$");
diff --git a/View/EngineerSetView.xaml b/View/EngineerSetView.xaml
index 4283578..c45504b 100644
--- a/View/EngineerSetView.xaml
+++ b/View/EngineerSetView.xaml
@@ -26,6 +26,8 @@
+
\ No newline at end of file
diff --git a/View/EngineerSetView.xaml.cs b/View/EngineerSetView.xaml.cs
index ca6b4f2..ba30e37 100644
--- a/View/EngineerSetView.xaml.cs
+++ b/View/EngineerSetView.xaml.cs
@@ -1,4 +1,5 @@
-using SunlightCentralizedControlManagement_SCCM_.ViewModel;
+using SunlightCentralizedControlManagement_SCCM_.UserClass;
+using SunlightCentralizedControlManagement_SCCM_.ViewModel;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
@@ -40,12 +41,17 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
string[] SQMOD = { "Windows Authentication", "SQL SERVER"};
comboBoxLanguage.ItemsSource = Language;
TEXT_SQMOD.ItemsSource = SQMOD;
- comboBoxLanguage.Text = Configini.IniReadvalue("SYS", "Language");
- TEXT_SQLIP.Text = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
- TEXT_SQLNAME.Text = Configini.IniReadvalue("SQL_SERVER", "SQL2");
- TEXT_SQMOD.Text = Configini.IniReadvalue("SQL_SERVER", "SQL3");
- TEXT_SQLUSER.Text = Configini.IniReadvalue("SQL_SERVER", "SQL4");
- TEXT_SQLPASWORD.Text = Configini.IniReadvalue("SQL_SERVER", "SQL5");
+ try
+ {
+ comboBoxLanguage.Text = Configini.IniReadvalue("SYS", "Language");
+ TEXT_SQLIP.Text = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
+ TEXT_SQLNAME.Text = Configini.IniReadvalue("SQL_SERVER", "SQL2");
+ TEXT_SQMOD.Text = Configini.IniReadvalue("SQL_SERVER", "SQL3");
+ TEXT_SQLUSER.Text = Configini.IniReadvalue("SQL_SERVER", "SQL4");
+ TEXT_SQLPASWORD.Text = Configini.IniReadvalue("SQL_SERVER", "SQL5");
+ dDispenser.IsChecked = Convert.ToBoolean(Configini.IniReadvalue("SYS", "DyelotsDispenser"));
+ }
+ catch (Exception ex) { LogGing.ERRDATA(ex); }
}
//调用配置文件
private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "SCCM.ini");
@@ -106,5 +112,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
MainWindowViewModel.SQL_LINK();//更新设定
}
}
+
+ private void dDispenser_Checked(object sender, RoutedEventArgs e)
+ {
+ Configini.IniWritevalue("SYS", "DyelotsDispenser", dDispenser.IsChecked.ToString());
+ MainWindowViewModel.DyelotsDispenser = (bool)dDispenser.IsChecked;
+ }
}
}
diff --git a/ViewModel/MainWindowViewModel.cs b/ViewModel/MainWindowViewModel.cs
index dd75763..a6883a8 100644
--- a/ViewModel/MainWindowViewModel.cs
+++ b/ViewModel/MainWindowViewModel.cs
@@ -55,13 +55,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
{
//调用配置文件
private static UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "SCCM.ini");
- public static string SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
- public static string SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
- public static string SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
- public static string SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
- public static string SQLPASWORD = Configini.IniReadvalue("SQL_SERVER", "SQL5");
- public static string SN_ID = Configini.IniReadvalue("SN", "SN2");
- public static string SN_KEY = Configini.IniReadvalue("SN", "SN1");
+ public static string SQLIP; //读配置文件
+ public static string SQLNAME;
+ public static string SQMOD;
+ public static string SQLUSER;
+ public static string SQLPASWORD;
+ public static string SN_ID;
+ public static string SN_KEY;
+ public static bool DyelotsDispenser;
public static SqlConnection conn_SC =new SqlConnection();//数据库
private SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
@@ -73,6 +74,19 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
public MainWindowViewModel()
{
+ try
+ {
+ SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
+ SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
+ SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
+ SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
+ SQLPASWORD = Configini.IniReadvalue("SQL_SERVER", "SQL5");
+ SN_ID = Configini.IniReadvalue("SN", "SN2");
+ SN_KEY = Configini.IniReadvalue("SN", "SN1");
+ DyelotsDispenser = Convert.ToBoolean(Configini.IniReadvalue("SYS", "DyelotsDispenser"));
+ }
+ catch (Exception ex) { LogGing.ERRDATA(ex); }
+
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
Machines = SQLiteHelpers.ExecuteDataSet("select * from Machines Order by id", null).Tables[0]; //读取表写入缓存