|
|
@@ -289,7 +289,7 @@ namespace UAS_LabelMachine
|
|
|
int len = port.BytesToRead;
|
|
|
byte[] readBuffer = new byte[len];
|
|
|
port.Read(readBuffer, 0, len); //将数据读入缓存
|
|
|
- string msg = Encoding.ASCII.GetString(readBuffer, 0, len); //获取出入库产品编号
|
|
|
+ string msg = Encoding.ASCII.GetString(readBuffer, 0, len).Replace("\n", "").Replace("\r", "").Replace("\t", ""); //获取出入库产品编号
|
|
|
int pib_pdno = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["pib_pdno"].Value.ToString());
|
|
|
if (DetailRange.Checked)
|
|
|
{
|
|
|
@@ -554,9 +554,9 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
ErrorMsg = "订单号不匹配";
|
|
|
}
|
|
|
+ //如果匹配到的行的品牌和当前正则的品牌不相等结束本次循环
|
|
|
if (LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].Value.ToString() != sg_brand)
|
|
|
{
|
|
|
- ErrorMsg = "";
|
|
|
continue;
|
|
|
}
|
|
|
else
|
|
|
@@ -592,7 +592,6 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
//获取当前最大的箱号
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value = DateCode;
|
|
|
-
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value = LotNo;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_ifmodify"].Value = true;
|
|
|
SetOutboxBarcode();
|
|
|
@@ -968,39 +967,7 @@ namespace UAS_LabelMachine
|
|
|
string[] param = new string[] { PI_ID, "" };
|
|
|
dh.CallProcedure("GetCustBarcode", ref param);
|
|
|
//}
|
|
|
- //获取客户自定义设置
|
|
|
- sql.Clear();
|
|
|
- sql.Append("select cu_print_middc,cu_print_limiteddate,cu_print_outdc,cu_print_dateformat,cu_print_checkdatecode,cu_print_midlotno,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_midspec,cu_print_midpo,cu_print_midprod,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
|
|
|
- sql.Append(",cu_print_outprod,cu_print_checkonly,nvl(cu_print_papercount,0)cu_print_papercount,cu_print_regexpression,cu_print_recheck from customer where cu_code='" + pi_cardcode.Text + "'");
|
|
|
- dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- BaseUtil.SetFormValue(this.Controls, dt);
|
|
|
- switch (dt.Rows[0]["cu_print_custprodmatchmodel"].ToString())
|
|
|
- {
|
|
|
- case "Equal":
|
|
|
- Equal.Checked = true;
|
|
|
- break;
|
|
|
- case "Expression":
|
|
|
- Expression.Checked = true;
|
|
|
- break;
|
|
|
- default:
|
|
|
- Equal.Checked = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- switch (dt.Rows[0]["cu_print_recheck"].ToString())
|
|
|
- {
|
|
|
- case "CP":
|
|
|
- RecheckCuprodcode.Checked = true;
|
|
|
- break;
|
|
|
- case "BR":
|
|
|
- RecheckBarcode.Checked = true;
|
|
|
- break;
|
|
|
- default:
|
|
|
- RecheckCuprodcode.Checked = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ RefreshParamData();
|
|
|
//查询所有的采集策略
|
|
|
sql.Clear();
|
|
|
sql.Append("select sg_id,sg_brand,si_item ,sg_script,max(si_expression)si_expression,instr(sg_name,si_name)itemindex,sg_name,si_name,sg_step from prodiodetail left join ");
|
|
|
@@ -1390,7 +1357,7 @@ namespace UAS_LabelMachine
|
|
|
//查询参数名称相同的获取到取值字段
|
|
|
for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
|
- DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
+ DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
{
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
@@ -1400,7 +1367,7 @@ namespace UAS_LabelMachine
|
|
|
DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (pib_outboxcode1 == "" ? "0" : pib_outboxcode1), "select");
|
|
|
for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
|
- DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
+ DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
{
|
|
|
MidDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
@@ -1444,7 +1411,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
if (MidDoc.Variables.FormVariables.Item(j + 1).Value == "")
|
|
|
{
|
|
|
- dr1 = Attach.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
+ dr1 = Attach.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0)
|
|
|
MidDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
|
@@ -1475,7 +1442,7 @@ namespace UAS_LabelMachine
|
|
|
sql.Clear();
|
|
|
for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
|
- DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
+ DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
{
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
@@ -1487,7 +1454,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
|
- DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
+ DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
{
|
|
|
OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
@@ -1531,7 +1498,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
if (OutBoxDoc.Variables.FormVariables.Item(j + 1).Value == "")
|
|
|
{
|
|
|
- dr1 = Attach.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
+ dr1 = Attach.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0)
|
|
|
OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
|
@@ -1584,6 +1551,14 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
|
|
|
private void LoadGridData()
|
|
|
+ {
|
|
|
+ thread = new Thread(LoadGridData1);
|
|
|
+ stw = new SetLoadingWindow(thread, "正在获取条码");
|
|
|
+ BaseUtil.SetFormCenter(stw);
|
|
|
+ stw.ShowDialog();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void LoadGridData1()
|
|
|
{
|
|
|
LoadGridData(new object(), new EventArgs());
|
|
|
}
|
|
|
@@ -1872,12 +1847,12 @@ namespace UAS_LabelMachine
|
|
|
for (int j = 0; j < LabelInf.Columns.Count; j++)
|
|
|
{
|
|
|
//去除ID列
|
|
|
- if (dt.Columns[i].ColumnName.ToLower().Contains("id") || dt.Columns[i].ColumnName.ToLower() == "pib_barcode" || dt.Columns[i].ColumnName.ToLower() == "pib_pdno" || dt.Columns[i].ColumnName.ToLower() == "pib_ifpick" || dt.Columns[i].ColumnName.ToLower() == "pib_ifprint" || dt.Columns[i].ColumnName.ToLower() == "pib_datecode1" || dt.Columns[i].ColumnName.ToLower() == "pr_vendprodcode")
|
|
|
+ if (dt.Columns[i].ColumnName.Contains("id") || dt.Columns[i].ColumnName == "pib_barcode" || dt.Columns[i].ColumnName == "pib_pdno" || dt.Columns[i].ColumnName == "pib_ifpick" || dt.Columns[i].ColumnName == "pib_ifprint" || dt.Columns[i].ColumnName == "pib_datecode1" || dt.Columns[i].ColumnName == "pr_vendprodcode")
|
|
|
{
|
|
|
dt.Columns.RemoveAt(i);
|
|
|
break;
|
|
|
}
|
|
|
- switch (dt.Columns[i].ColumnName.ToLower())
|
|
|
+ switch (dt.Columns[i].ColumnName)
|
|
|
{
|
|
|
case "pib_lotno":
|
|
|
dt.Columns[i].ColumnName = "批次号";
|
|
|
@@ -1891,7 +1866,7 @@ namespace UAS_LabelMachine
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- if (dt.Columns[i].ColumnName.ToLower() == LabelInf.Columns[j].DataPropertyName.ToLower())
|
|
|
+ if (dt.Columns[i].ColumnName == LabelInf.Columns[j].DataPropertyName)
|
|
|
{
|
|
|
dt.Columns[i].ColumnName = LabelInf.Columns[j].HeaderText;
|
|
|
break;
|
|
|
@@ -1914,7 +1889,7 @@ namespace UAS_LabelMachine
|
|
|
Properties.Settings.Default.MidBoxCapacity = nup.Value;
|
|
|
Properties.Settings.Default.Save();
|
|
|
break;
|
|
|
- case "OutboxCapacity":
|
|
|
+ case "OutBoxCapacity":
|
|
|
Properties.Settings.Default.OutboxCapacity = nup.Value;
|
|
|
Properties.Settings.Default.Save();
|
|
|
break;
|
|
|
@@ -1925,7 +1900,7 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
private void RefreshDBConnect_Tick(object sender, EventArgs e)
|
|
|
{
|
|
|
- dh.getRowCount("employee", "1=1");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void ButtonSetting_Click(object sender, EventArgs e)
|
|
|
@@ -1941,11 +1916,13 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
case "采集策略设置":
|
|
|
采集策略_NEW form = new 采集策略_NEW();
|
|
|
+ form.FormClosed += Form_FormClosed;
|
|
|
BaseUtil.SetFormCenter(form);
|
|
|
form.ShowDialog();
|
|
|
break;
|
|
|
case "生成条码":
|
|
|
生成条码 form3 = new 生成条码(pi_inoutno.Text);
|
|
|
+ form3.FormClosed += Form_FormClosed;
|
|
|
BaseUtil.SetFormCenter(form3);
|
|
|
form3.ShowDialog();
|
|
|
break;
|
|
|
@@ -1953,12 +1930,14 @@ namespace UAS_LabelMachine
|
|
|
if (pi_cardcode.Text != "")
|
|
|
{
|
|
|
附件内容打印 att = new 附件内容打印(pi_cardcode.Text);
|
|
|
+ att.FormClosed += Attach_Closed;
|
|
|
att.ShowDialog();
|
|
|
}
|
|
|
else MessageBox.Show("请先获取出库单信息");
|
|
|
break;
|
|
|
case "客户标签维护":
|
|
|
客户标签维护 form1 = new 客户标签维护();
|
|
|
+ form1.FormClosed += Form_FormClosed;
|
|
|
BaseUtil.SetFormCenter(form1);
|
|
|
if (SingleDoc != null)
|
|
|
SingleDoc.Close();
|
|
|
@@ -1971,12 +1950,13 @@ namespace UAS_LabelMachine
|
|
|
break;
|
|
|
case "客户采集规则":
|
|
|
CustomerRule cust = new CustomerRule();
|
|
|
+ cust.FormClosed += Form_FormClosed;
|
|
|
BaseUtil.SetFormCenter(cust);
|
|
|
cust.ShowDialog();
|
|
|
break;
|
|
|
case "参数配置":
|
|
|
ParamSetting form2 = new ParamSetting();
|
|
|
- form2.FormClosed += Form2_FormClosed;
|
|
|
+ form2.FormClosed += Form_FormClosed;
|
|
|
BaseUtil.SetFormCenter(form2);
|
|
|
form2.ShowDialog();
|
|
|
break;
|
|
|
@@ -1990,9 +1970,14 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void Form2_FormClosed(object sender, FormClosedEventArgs e)
|
|
|
+ private void Form_FormClosed(object sender, FormClosedEventArgs e)
|
|
|
{
|
|
|
- RefreshPLCInstruct();
|
|
|
+ RefreshParamData();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Attach_Closed(object sender, FormClosedEventArgs e)
|
|
|
+ {
|
|
|
+ RefreshAttachData();
|
|
|
}
|
|
|
|
|
|
private void DetailRange_CheckedChanged(object sender, EventArgs e)
|
|
|
@@ -2330,7 +2315,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(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();
|
|
|
@@ -2346,19 +2331,17 @@ 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(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");
|
|
|
for (int i = 0; i < pibid_dt.Rows.Count; i++)
|
|
|
{
|
|
|
- SinglePrint(pibid_dt.Rows[i]["pib_id1"].ToString());
|
|
|
+ SinglePrint(pibid_dt.Rows[i]["pib_id"].ToString());
|
|
|
}
|
|
|
setvalueandprint.FindForm().Close();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private void ResetBarcode_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
string close = MessageBox.Show(this.ParentForm, "是否重置本单据条码", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
@@ -2387,23 +2370,30 @@ 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;
|
|
|
+ //获取当前的行号
|
|
|
+ int CurrentRowNum = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["rownum"].Value.ToString());
|
|
|
//超过中盒容量中盒号+1
|
|
|
if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
|
|
|
{
|
|
|
outboxcode1 = outboxcode1 + 1;
|
|
|
GetBarcode = true;
|
|
|
LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
}
|
|
|
- //获取当前的行号
|
|
|
- int CurrentRowNum = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["rownum"].Value.ToString());
|
|
|
- //获取上一行的数据
|
|
|
- DataTable LastRowData = null;
|
|
|
- if (CurrentRowNum - 1 > 0)
|
|
|
+ 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");
|
|
|
+ string custmidboxcode = LastRowData.Rows[0]["pib_custmidboxcode"].ToString();
|
|
|
+ if (custmidboxcode == "")
|
|
|
+ {
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ }
|
|
|
//或者不符合合并条件中盒号+1
|
|
|
if (cu_print_midlotno.Checked)
|
|
|
{
|
|
|
@@ -2480,6 +2470,13 @@ 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");
|
|
|
+ string custoutboxcode = LastRowData.Rows[0]["pib_custoutboxcode"].ToString();
|
|
|
+ if (custoutboxcode == "")
|
|
|
+ {
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ }
|
|
|
//或者不符合合并条件中盒号+1
|
|
|
if (cu_print_outlotno.Checked)
|
|
|
{
|
|
|
@@ -2553,18 +2550,19 @@ namespace UAS_LabelMachine
|
|
|
sql.Clear();
|
|
|
for (int j = 0; j < SingleDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
|
- DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
+ DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0)
|
|
|
{
|
|
|
- if (dr1[0]["lp_sql"].ToString() == "字符串")
|
|
|
+ if (dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
}
|
|
|
}
|
|
|
sql.Append("1,");
|
|
|
DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_id=" + pib_id, "select");
|
|
|
+ Console.WriteLine("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_id=" + pib_id);
|
|
|
for (int j = 0; j < SingleDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
|
- DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
+ DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
|
|
|
{
|
|
|
DataTable dt1 = (DataTable)adh.ExecuteSql(dr1[0]["lp_sql"].ToString().Replace("{1}", pib_id), "select");
|
|
|
@@ -2590,13 +2588,13 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+ else if (dr1.Length > 0)
|
|
|
{
|
|
|
SingleDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
}
|
|
|
if (SingleDoc.Variables.FormVariables.Item(j + 1).Value == "")
|
|
|
{
|
|
|
- dr1 = Attach.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
+ dr1 = Attach.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0)
|
|
|
SingleDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
|
@@ -2605,5 +2603,47 @@ namespace UAS_LabelMachine
|
|
|
SingleDoc.PrintDocument();
|
|
|
LogicHandler.UpdateRowPrinted(pib_id);
|
|
|
}
|
|
|
+
|
|
|
+ private void RefreshAttachData()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void RefreshParamData()
|
|
|
+ {
|
|
|
+ //获取客户自定义设置
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("select cu_print_middc,cu_print_limiteddate,cu_print_outdc,cu_print_dateformat,cu_print_checkdatecode,cu_print_midlotno,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_midspec,cu_print_midpo,cu_print_midprod,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
|
|
|
+ sql.Append(",cu_print_outprod,cu_print_checkonly,nvl(cu_print_papercount,0)cu_print_papercount,cu_print_regexpression,cu_print_recheck from customer where cu_code='" + pi_cardcode.Text + "'");
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ BaseUtil.SetFormValue(this.Controls, dt);
|
|
|
+ switch (dt.Rows[0]["cu_print_custprodmatchmodel"].ToString())
|
|
|
+ {
|
|
|
+ case "Equal":
|
|
|
+ Equal.Checked = true;
|
|
|
+ break;
|
|
|
+ case "Expression":
|
|
|
+ Expression.Checked = true;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ Equal.Checked = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ switch (dt.Rows[0]["cu_print_recheck"].ToString())
|
|
|
+ {
|
|
|
+ case "CP":
|
|
|
+ RecheckCuprodcode.Checked = true;
|
|
|
+ break;
|
|
|
+ case "BR":
|
|
|
+ RecheckBarcode.Checked = true;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ RecheckCuprodcode.Checked = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|