|
|
@@ -129,8 +129,6 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
string OutSQL = "";
|
|
|
|
|
|
- DataTable Attach;
|
|
|
-
|
|
|
private bool EnablePrint = true;
|
|
|
|
|
|
string[] PIBID;
|
|
|
@@ -572,7 +570,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
SingleLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + SingleLabelCombox.SelectedValue.ToString().Split('#')[0] + " and lp_name in(" + ParamCondition + ") order by lp_detno", "select");
|
|
|
- Attach = (DataTable)dh.ExecuteSql("select lap_param lp_name,lap_value lp_sql from LABELATTACHPARAMETER where lap_custcode='" + pi_cardcode.Text + "' and lap_param in(" + ParamCondition + ")", "select");
|
|
|
+ DataTable Attach = (DataTable)dh.ExecuteSql("select lap_param lp_name,lap_value lp_sql from LABELATTACHPARAMETER where lap_custcode='" + pi_cardcode.Text + "' and lap_param in(" + ParamCondition + ")", "select");
|
|
|
SingleSQL = "select * from ";
|
|
|
for (int i = 0; i < SingleLabelParam.Rows.Count; i++)
|
|
|
{
|
|
|
@@ -626,11 +624,11 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
MidLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + MidLabelCombox.SelectedValue.ToString().Split('#')[0] + " and lp_name in(" + ParamCondition + ") order by lp_detno", "select");
|
|
|
- Attach = (DataTable)dh.ExecuteSql("select lap_param lp_name,lap_value lp_sql from LABELATTACHPARAMETER where lap_custcode='" + pi_cardcode.Text + "' and lap_param in(" + ParamCondition + ")", "select");
|
|
|
+ DataTable Attach = (DataTable)dh.ExecuteSql("select lap_param lp_name,lap_value lp_sql from LABELATTACHPARAMETER where lap_custcode='" + pi_cardcode.Text + "' and lap_param in(" + ParamCondition + ")", "select");
|
|
|
MidSQL = "select * from ";
|
|
|
for (int i = 0; i < MidLabelParam.Rows.Count; i++)
|
|
|
{
|
|
|
- if (i != MidLabelParam.Rows.Count - 1 && Attach.Rows.Count > 0)
|
|
|
+ if (i != MidLabelParam.Rows.Count - 1 || Attach.Rows.Count > 0)
|
|
|
MidSQL += "(" + MidLabelParam.Rows[i]["lp_sql"].ToString() + "),";
|
|
|
else
|
|
|
MidSQL += "(" + MidLabelParam.Rows[i]["lp_sql"].ToString() + ")";
|
|
|
@@ -681,11 +679,11 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
OutLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + OutBoxCombox.SelectedValue.ToString().Split('#')[0] + " and lp_name in(" + ParamCondition + ") order by lp_detno", "select");
|
|
|
- Attach = (DataTable)dh.ExecuteSql("select lap_param lp_name,lap_value lp_sql from LABELATTACHPARAMETER where lap_custcode='" + pi_cardcode.Text + "' and lap_param in(" + ParamCondition + ")", "select");
|
|
|
+ DataTable Attach = (DataTable)dh.ExecuteSql("select lap_param lp_name,lap_value lp_sql from LABELATTACHPARAMETER where lap_custcode='" + pi_cardcode.Text + "' and lap_param in(" + ParamCondition + ")", "select");
|
|
|
OutSQL = "select * from ";
|
|
|
for (int i = 0; i < OutLabelParam.Rows.Count; i++)
|
|
|
{
|
|
|
- if (i != OutLabelParam.Rows.Count - 1)
|
|
|
+ if (i != OutLabelParam.Rows.Count - 1 || Attach.Rows.Count > 0)
|
|
|
OutSQL += "(" + OutLabelParam.Rows[i]["lp_sql"].ToString() + "),";
|
|
|
else
|
|
|
OutSQL += "(" + OutLabelParam.Rows[i]["lp_sql"].ToString() + ")";
|
|
|
@@ -923,6 +921,7 @@ namespace UAS_LabelMachine
|
|
|
stw = new SetLoadingWindow(thread, "正在打印单盘");
|
|
|
BaseUtil.SetFormCenter(stw);
|
|
|
stw.ShowDialog();
|
|
|
+ Input.Focus();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -1225,7 +1224,7 @@ namespace UAS_LabelMachine
|
|
|
//获取对应行的pib_id
|
|
|
string ParamName = OutLabelParam.Rows[k]["lp_name"].ToString();
|
|
|
OutBoxDoc.Variables.FreeVariables.Item(ParamName).Value = dt.Rows[0][k].ToString();
|
|
|
- LogManager.DoLog("打印参数【" + OutBoxDoc.Variables.FreeVariables.Item(ParamName).Name + "】赋值," + ",取到值" + OutBoxDoc.Variables.FreeVariables.Item(ParamName).Value);
|
|
|
+ LogManager.DoLog("打印参数【" + OutBoxDoc.Variables.FreeVariables.Item(ParamName).Name + "】赋值" + ",取到值" + OutBoxDoc.Variables.FreeVariables.Item(ParamName).Value);
|
|
|
}
|
|
|
//保存参数打印
|
|
|
OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
|
|
|
@@ -1271,6 +1270,7 @@ namespace UAS_LabelMachine
|
|
|
stw = new SetLoadingWindow(thread, "正在打印外箱");
|
|
|
BaseUtil.SetFormCenter(stw);
|
|
|
stw.ShowDialog();
|
|
|
+ Input.Focus();
|
|
|
}
|
|
|
else
|
|
|
MessageBox.Show("未维护外箱标签", "提示");
|
|
|
@@ -1511,7 +1511,7 @@ namespace UAS_LabelMachine
|
|
|
eh.ExportExcel(dt, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_inoutno.Text);
|
|
|
string close = MessageBox.Show(this.ParentForm, "导出成功,是否打开文件", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
if (close.ToString() == "Yes")
|
|
|
- System.Diagnostics.Process.Start(ExportFileDialog.SelectedPath + "\\" + pi_date.Text + "-" + pi_inoutno.Text + ".xls");
|
|
|
+ Process.Start(ExportFileDialog.SelectedPath + "\\" + pi_date.Text + "-" + pi_inoutno.Text + ".xls");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1545,7 +1545,7 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
private void RefreshDBConnect_Tick(object sender, EventArgs e)
|
|
|
{
|
|
|
- dh.ExecuteSql("select count(1) from employee", "select");
|
|
|
+ dh.ExecuteSql("select sysdate from dual", "select");
|
|
|
}
|
|
|
|
|
|
private void LoadPrcodeData()
|
|
|
@@ -1563,8 +1563,6 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private void OutBoxNum_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
OutBoxNum.Items.Clear();
|