Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
2794a1e9ed
2 files changed
+128
-8
No files matched your search
+114
-1
@@ -22,6 +22,8 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using static DyeingComputer.UserClass.SqliteHelper;
|
using static DyeingComputer.UserClass.SqliteHelper;
|
||||||
using DyeingComputer.View;
|
using DyeingComputer.View;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace DyeingComputer.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{/// <summary>
|
{/// <summary>
|
||||||
@@ -181,7 +183,7 @@ namespace DyeingComputer.UserClass
|
|||||||
else if (dat_821.GetValue("INSTRUCTION").ToString() == "CONTINUE")
|
else if (dat_821.GetValue("INSTRUCTION").ToString() == "CONTINUE")
|
||||||
{
|
{
|
||||||
MainWindowViewModel.WORK_RUN = 2;//暂停
|
MainWindowViewModel.WORK_RUN = 2;//暂停
|
||||||
}
|
}
|
||||||
else if (dat_821.GetValue("INSTRUCTION").ToString() == "JUMP")
|
else if (dat_821.GetValue("INSTRUCTION").ToString() == "JUMP")
|
||||||
{
|
{
|
||||||
MainWindowViewModel.RUN_DATATABLE = TechnologicalProcessView.sql.Tables[0];//缓存表
|
MainWindowViewModel.RUN_DATATABLE = TechnologicalProcessView.sql.Tables[0];//缓存表
|
||||||
@@ -189,6 +191,117 @@ namespace DyeingComputer.UserClass
|
|||||||
MainWindowViewModel.STEP_START(dat_821.GetValue("Numder").ToString(), Convert.ToDouble(dat_821.GetValue("P1")),
|
MainWindowViewModel.STEP_START(dat_821.GetValue("Numder").ToString(), Convert.ToDouble(dat_821.GetValue("P1")),
|
||||||
Convert.ToDouble(dat_821.GetValue("P2")), Convert.ToDouble(dat_821.GetValue("P3")),
|
Convert.ToDouble(dat_821.GetValue("P2")), Convert.ToDouble(dat_821.GetValue("P3")),
|
||||||
Convert.ToDouble(dat_821.GetValue("P4")), Convert.ToDouble(dat_821.GetValue("P5")));
|
Convert.ToDouble(dat_821.GetValue("P4")), Convert.ToDouble(dat_821.GetValue("P5")));
|
||||||
|
}
|
||||||
|
else if (dat_821.GetValue("INSTRUCTION").ToString() == "INSERT")
|
||||||
|
{
|
||||||
|
int d = Convert.ToInt16( dat_821.GetValue("ID"));
|
||||||
|
TechnologicalProcessView.SQLiteHelpers = new SQLiteHelper(TechnologicalProcessView.DBAddress); //数据库连接路径
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.Open(); //打开数据库
|
||||||
|
|
||||||
|
string ProgramID = TechnologicalProcessView.SQLiteHelpers.ExecuteScalar("select ProgramID from RUN where Step = '1'", null).ToString();
|
||||||
|
string ProgramNAME = TechnologicalProcessView.SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.Close();
|
||||||
|
DataRow dr = TechnologicalProcessView.sql.Tables[0].NewRow();//添加表数据
|
||||||
|
dr["ProgramID"] = ProgramID;
|
||||||
|
dr["Program"] = ProgramNAME;
|
||||||
|
|
||||||
|
TechnologicalProcessView.sql.Tables[0].Rows.InsertAt(dr, d - 1);
|
||||||
|
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
|
||||||
|
for (int i = 0; i < a; i++)
|
||||||
|
{
|
||||||
|
DataRow drt = TechnologicalProcessView.sql.Tables[0].Rows[i];
|
||||||
|
drt.BeginEdit();
|
||||||
|
drt["Step"] = i + 1;
|
||||||
|
drt.EndEdit();
|
||||||
|
}
|
||||||
|
|
||||||
|
DataRow drtt = TechnologicalProcessView.sql.Tables[0].Rows[d - 1];
|
||||||
|
drtt.BeginEdit();
|
||||||
|
drtt["StepID"] = dat_821.GetValue("STEPID").ToString();
|
||||||
|
drtt["StepName"] = dat_821.GetValue("STEPNAME").ToString();
|
||||||
|
drtt["ParameterName"] = dat_821.GetValue("PNAME").ToString();
|
||||||
|
drtt["Parameter1"] = dat_821.GetValue("P1").ToString();
|
||||||
|
drtt["Parameter2"] = dat_821.GetValue("P2").ToString();
|
||||||
|
drtt["Parameter3"] = dat_821.GetValue("P3").ToString();
|
||||||
|
drtt["Parameter4"] = dat_821.GetValue("P4").ToString();
|
||||||
|
drtt["Parameter5"] = dat_821.GetValue("P5").ToString();
|
||||||
|
drtt.EndEdit();
|
||||||
|
|
||||||
|
var _TechnologicalProcessView = Application.Current.Windows.Cast<UserControl>().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面
|
||||||
|
_TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView;
|
||||||
|
_TechnologicalProcessView.Grid.SelectedIndex = -1;
|
||||||
|
|
||||||
|
TechnologicalProcessView.SQLiteHelpers = new SQLiteHelper(TechnologicalProcessView.DBAddress); //数据库连接路径
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.Open(); //打开数据库
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.Delete("RUN", null, null);
|
||||||
|
DataTable data_t = new DataTable();
|
||||||
|
data_t.Columns.Add("DYELOT", typeof(string)); //添加列
|
||||||
|
data_t = TechnologicalProcessView.sql.Tables[0].Clone();
|
||||||
|
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
|
||||||
|
for (int i = 0; i < a; i++)
|
||||||
|
{
|
||||||
|
data_t.Clear();//清空
|
||||||
|
|
||||||
|
DataRow dt = TechnologicalProcessView.sql.Tables[0].Rows[i];//行转换
|
||||||
|
DataRow drT = data_t.NewRow();
|
||||||
|
drT.ItemArray = dt.ItemArray;
|
||||||
|
data_t.Rows.InsertAt(drT, 0);
|
||||||
|
dr.BeginEdit(); //添加订单号
|
||||||
|
dr["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
|
dr.EndEdit();
|
||||||
|
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.InsertData("RUN", TechnologicalProcessView.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||||
|
}
|
||||||
|
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接
|
||||||
|
}//插入
|
||||||
|
else if (dat_821.GetValue("INSTRUCTION").ToString() == "EDIT")
|
||||||
|
{
|
||||||
|
int n = Convert.ToInt16(dat_821.GetValue("ID").ToString());
|
||||||
|
|
||||||
|
DataRow dr = TechnologicalProcessView.sql.Tables[0].Rows[n - 1];
|
||||||
|
dr.BeginEdit();
|
||||||
|
dr["StepID"] = dat_821.GetValue("STEPID").ToString();
|
||||||
|
dr["StepName"] = dat_821.GetValue("STEPNAME").ToString();
|
||||||
|
dr["ParameterName"] = dat_821.GetValue("PNAME").ToString();
|
||||||
|
dr["Parameter1"] = dat_821.GetValue("P1").ToString();
|
||||||
|
dr["Parameter2"] = dat_821.GetValue("P2").ToString();
|
||||||
|
dr["Parameter3"] = dat_821.GetValue("P3").ToString();
|
||||||
|
dr["Parameter4"] = dat_821.GetValue("P4").ToString();
|
||||||
|
dr["Parameter5"] = dat_821.GetValue("P5").ToString();
|
||||||
|
dr.EndEdit();
|
||||||
|
|
||||||
|
var _TechnologicalProcessView = Application.Current.Windows.Cast<UserControl>().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面
|
||||||
|
_TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView;
|
||||||
|
_TechnologicalProcessView.Grid.SelectedIndex = -1;
|
||||||
|
|
||||||
|
TechnologicalProcessView.SQLiteHelpers = new SQLiteHelper(TechnologicalProcessView.DBAddress); //数据库连接路径
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.Open(); //打开数据库
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.Delete("RUN", null, null);
|
||||||
|
DataTable data_t = new DataTable();
|
||||||
|
data_t.Columns.Add("DYELOT", typeof(string)); //添加列
|
||||||
|
data_t = TechnologicalProcessView.sql.Tables[0].Clone();
|
||||||
|
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
|
||||||
|
for (int i = 0; i < a; i++)
|
||||||
|
{
|
||||||
|
data_t.Clear();//清空
|
||||||
|
|
||||||
|
DataRow dt = TechnologicalProcessView.sql.Tables[0].Rows[i];//行转换
|
||||||
|
DataRow drT = data_t.NewRow();
|
||||||
|
drT.ItemArray = dt.ItemArray;
|
||||||
|
data_t.Rows.InsertAt(drT, 0);
|
||||||
|
dr.BeginEdit(); //添加订单号
|
||||||
|
dr["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
|
dr.EndEdit();
|
||||||
|
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.InsertData("RUN", TechnologicalProcessView.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||||
|
}
|
||||||
|
|
||||||
|
TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接
|
||||||
|
}
|
||||||
|
else if (dat_821.GetValue("INSTRUCTION").ToString() == "DELETE")
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
client.SendAsync("SC821" + SYSKEY + SYSDAT);
|
client.SendAsync("SC821" + SYSKEY + SYSDAT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ namespace DyeingComputer.View
|
|||||||
|
|
||||||
public static object workName;
|
public static object workName;
|
||||||
public static string Program_Name;
|
public static string Program_Name;
|
||||||
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
public static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||||
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
public static readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
||||||
public static DataSet sql; //内存数据缓存
|
public static DataSet sql; //内存数据缓存
|
||||||
|
|
||||||
private void TechnologicalProcess_Import()
|
private void TechnologicalProcess_Import()
|
||||||
@@ -145,8 +145,8 @@ namespace DyeingComputer.View
|
|||||||
}
|
}
|
||||||
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
||||||
{
|
{
|
||||||
int n = StrToInt.To16Convert10(ID);
|
int n = Convert.ToInt16(ID);
|
||||||
|
ID=null;
|
||||||
DataRow dr = sql.Tables[0].Rows[n - 1];
|
DataRow dr = sql.Tables[0].Rows[n - 1];
|
||||||
dr.BeginEdit();
|
dr.BeginEdit();
|
||||||
dr["StepID"] = e.StepID;
|
dr["StepID"] = e.StepID;
|
||||||
@@ -223,16 +223,23 @@ namespace DyeingComputer.View
|
|||||||
|
|
||||||
SQLiteHelpers.Close();
|
SQLiteHelpers.Close();
|
||||||
|
|
||||||
if (ID != null) { d = StrToInt.To16Convert10(ID); } else { return; }
|
if (ID != null) { d = Convert.ToInt16(ID); } else { return; }
|
||||||
DataRow dr = sql.Tables[0].NewRow();//添加表数据
|
DataRow dr = sql.Tables[0].NewRow();//添加表数据
|
||||||
dr["ProgramID"] = ProgramID;
|
dr["ProgramID"] = ProgramID;
|
||||||
dr["Program"] = ProgramNAME;
|
dr["Program"] = ProgramNAME;
|
||||||
|
|
||||||
sql.Tables[0].Rows.InsertAt(dr, d - 1);
|
sql.Tables[0].Rows.InsertAt(dr, d - 1);
|
||||||
ID = null;
|
// ID = null;
|
||||||
|
|
||||||
Dat();
|
Dat();
|
||||||
Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
|
||||||
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; }
|
||||||
|
if (ID == null) ID = sql.Tables[0].Rows.Count.ToString();
|
||||||
|
ViewStep viewstop = new ViewStep(null, "0", "0", "0", "0", "0");
|
||||||
|
viewstop.data = ID;
|
||||||
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
|
||||||
|
viewstop.ShowDialog();
|
||||||
|
//Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
||||||
}
|
}
|
||||||
|
|
||||||
string Numder = null;
|
string Numder = null;
|
||||||
|
|||||||
Reference in new issue
Block a user