|
|
@@ -24,6 +24,8 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
DataHelper dh;
|
|
|
|
|
|
+ DataHelper dh1;
|
|
|
+
|
|
|
AccessDBHelper adh;
|
|
|
|
|
|
AccessDBHelper back_adh;
|
|
|
@@ -136,6 +138,7 @@ namespace UAS_LabelMachine
|
|
|
//用计时器重置数据库链接
|
|
|
LogManager.DoLog("程序启动,登陆人员【" + User.UserName + "】");
|
|
|
dh = SystemInf.dh;
|
|
|
+ dh1 = SystemInf.dh1;
|
|
|
adh = SystemInf.adh;
|
|
|
back_adh = SystemInf.back_adh;
|
|
|
CheckForIllegalCrossThreadCalls = false;
|
|
|
@@ -360,7 +363,6 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
break;
|
|
|
case "BackendCheck":
|
|
|
-
|
|
|
BackCheck.Text = msg;
|
|
|
if (BackendCheckFunction(msg, "Auto", out ErrorMsg))
|
|
|
{
|
|
|
@@ -460,7 +462,7 @@ namespace UAS_LabelMachine
|
|
|
string month = "";
|
|
|
string day = "";
|
|
|
string date = "";
|
|
|
- LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
+ LogicHandler.GetTimeFromDatecode(dh,DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
System.DateTime dtime;
|
|
|
//有效期比对
|
|
|
if (System.DateTime.TryParseExact(date, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out dtime))
|
|
|
@@ -700,7 +702,7 @@ namespace UAS_LabelMachine
|
|
|
dr[0]["pib_datecode"] = DateCode;
|
|
|
try
|
|
|
{
|
|
|
- LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
+ LogicHandler.GetTimeFromDatecode(dh1,DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
dr[0]["pib_year"] = year;
|
|
|
dr[0]["pib_month"] = month;
|
|
|
dr[0]["pib_day"] = day;
|
|
|
@@ -776,7 +778,7 @@ namespace UAS_LabelMachine
|
|
|
//解析DateCode,将值设置到年月日
|
|
|
try
|
|
|
{
|
|
|
- LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
+ LogicHandler.GetTimeFromDatecode(dh1,DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_year"].Value = year;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_month"].Value = month;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_day"].Value = day;
|
|
|
@@ -2320,7 +2322,7 @@ namespace UAS_LabelMachine
|
|
|
string month = "0";
|
|
|
string day = "0";
|
|
|
string date = "";
|
|
|
- LogicHandler.GetTimeFromDatecode(datecode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
+ LogicHandler.GetTimeFromDatecode(dh1,datecode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
adh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_ifmodify=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "update");
|
|
|
LoadGridData();
|
|
|
setvalue.FindForm().Close();
|
|
|
@@ -2336,7 +2338,7 @@ namespace UAS_LabelMachine
|
|
|
string month = "0";
|
|
|
string day = "0";
|
|
|
string date = "";
|
|
|
- LogicHandler.GetTimeFromDatecode(datecode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
+ LogicHandler.GetTimeFromDatecode(dh1,datecode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
adh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_ifmodify=-1,pib_ifprint=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "update");
|
|
|
LoadGridData();
|
|
|
DataTable pibid_dt = (DataTable)adh.ExecuteSql("select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "select");
|
|
|
@@ -2366,7 +2368,7 @@ namespace UAS_LabelMachine
|
|
|
//解析DateCode,将值设置到年月日
|
|
|
try
|
|
|
{
|
|
|
- LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
+ LogicHandler.GetTimeFromDatecode(dh,DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_year"].Value = year;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_month"].Value = month;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_day"].Value = day;
|
|
|
@@ -2375,8 +2377,6 @@ namespace UAS_LabelMachine
|
|
|
int outboxcode1 = int.Parse(Process_midboxcode.Text == "" ? "1" : Process_midboxcode.Text);
|
|
|
int outboxcode2 = int.Parse(Process_outboxcode.Text == "" ? "1" : Process_outboxcode.Text);
|
|
|
string pd_id = LabelInf.Rows[CurrentRowIndex].Cells["pd_id"].Value.ToString();
|
|
|
- //获取上一行的数据
|
|
|
- DataTable LastRowData = null;
|
|
|
//如果满容量获取过箱号就不再重复获取了
|
|
|
bool GetBarcode = false;
|
|
|
//获取当前的行号
|
|
|
@@ -2392,7 +2392,8 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else if (CurrentRowNum - 1 > 0)
|
|
|
{
|
|
|
- LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
|
|
|
+ //获取上一行的数据
|
|
|
+ DataTable LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
|
|
|
string custmidboxcode = LastRowData.Rows[0]["pib_custmidboxcode"].ToString();
|
|
|
if (custmidboxcode == "")
|
|
|
{
|
|
|
@@ -2475,7 +2476,8 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else if (CurrentRowNum - 1 > 0)
|
|
|
{
|
|
|
- LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
|
|
|
+ //获取上一行数据
|
|
|
+ DataTable LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
|
|
|
string custoutboxcode = LastRowData.Rows[0]["pib_custoutboxcode"].ToString();
|
|
|
if (custoutboxcode == "")
|
|
|
{
|