|
@@ -174,6 +174,11 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
|
|
|
Process[] processes = System.Diagnostics.Process.GetProcessesByName("lppa");
|
|
|
+ Process[] processes1 = System.Diagnostics.Process.GetProcessesByName("bartend");
|
|
|
+ for (int i = 0; i < processes1.Length; i++)
|
|
|
+ {
|
|
|
+ processes1[i].Kill();
|
|
|
+ }
|
|
|
for (int i = 0; i < processes.Length; i++)
|
|
|
{
|
|
|
processes[i].Kill();
|
|
@@ -248,7 +253,7 @@ namespace UAS_LabelMachine
|
|
|
asc.controllInitializeSize(this);
|
|
|
asc.controlAutoSize(this);
|
|
|
|
|
|
- string Code = dh.GetConfig("", "").ToString();
|
|
|
+ string Code = dh.GetConfig("PrintMethod", "CodeOrBar").ToString() ;
|
|
|
if (Code == "")
|
|
|
{
|
|
|
try
|
|
@@ -1039,12 +1044,11 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
if (SingleLabelCombox.Text != "")
|
|
|
{
|
|
|
- SingleDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
|
|
|
- SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
|
- 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], "select");
|
|
|
- for (int i = 0; i < SingleDoc.Variables.FreeVariables.Count; i++)
|
|
|
+ if (PrintMethod == "CodeSoft")
|
|
|
{
|
|
|
- SingleParam.Add(SingleDoc.Variables.FreeVariables.Item(i + 1).Name);
|
|
|
+ SingleDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
|
|
|
+ SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
|
+ 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], "select");
|
|
|
}
|
|
|
}
|
|
|
sql.Clear();
|
|
@@ -1069,9 +1073,12 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
if (MidLabelCombox.Text != "")
|
|
|
{
|
|
|
- MidDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + MidLabelCombox.Text);
|
|
|
- MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
|
|
|
- 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], "select");
|
|
|
+ if (PrintMethod == "CodeSoft")
|
|
|
+ {
|
|
|
+ MidDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + MidLabelCombox.Text);
|
|
|
+ MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
|
|
|
+ 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], "select");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
sql.Clear();
|
|
@@ -1096,14 +1103,17 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
if (OutBoxCombox.Text != "")
|
|
|
{
|
|
|
- OutBoxDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + OutBoxCombox.Text);
|
|
|
- OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
|
|
|
- OutLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + OutBoxCombox.SelectedValue.ToString().Split('#')[0], "select");
|
|
|
+ if (PrintMethod == "CodeSoft")
|
|
|
+ {
|
|
|
+ OutBoxDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + OutBoxCombox.Text);
|
|
|
+ OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
|
|
|
+ OutLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + OutBoxCombox.SelectedValue.ToString().Split('#')[0], "select");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
ComBoxClickChangeLabelDoc = true;
|
|
|
- GetSingleBoxData();
|
|
|
- GetMidBoxData();
|
|
|
+ GetSingleBoxData(PrintMethod);
|
|
|
+ GetMidBoxData(PrintMethod);
|
|
|
}
|
|
|
bool InitGetLabel = true;
|
|
|
|
|
@@ -1188,11 +1198,6 @@ namespace UAS_LabelMachine
|
|
|
MessageBox.Show("中盘标签未维护参数");
|
|
|
}
|
|
|
}
|
|
|
- string la_id = SingleLabelCombox.SelectedValue.ToString().Split('#')[0];
|
|
|
- string cl_labelname = SingleLabelCombox.Text;
|
|
|
- string LabelUrl = dh.getFieldDataByCondition("label left join customerlabel on la_code=cl_labelcode", "cl_labelurl", "la_id='" + la_id + "' and cl_labelname='" + cl_labelname + "'").ToString();
|
|
|
-
|
|
|
- dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + la_id, "select");
|
|
|
if (SingleLabelParam.Rows.Count > 0 && LabelInf.Rows.Count > 0)
|
|
|
{
|
|
|
|
|
@@ -1222,9 +1227,9 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
|
|
|
if (SingleBoxCacheData.Rows.Count == 0)
|
|
|
- GetSingleBoxData();
|
|
|
+ GetSingleBoxData(PrintMethod);
|
|
|
if (MidBoxCacheData.Rows.Count == 0)
|
|
|
- GetMidBoxData();
|
|
|
+ GetMidBoxData(PrintMethod);
|
|
|
for (int i = 0; i < LabelInf.RowCount; i++)
|
|
|
{
|
|
|
if (i + 1 < LabelInf.RowCount)
|
|
@@ -1299,161 +1304,167 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
|
|
|
|
|
|
- private void GetSingleBoxData()
|
|
|
+ private void GetSingleBoxData(string PrintMethod)
|
|
|
{
|
|
|
- if (SingleDoc == null)
|
|
|
- return;
|
|
|
- for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
- {
|
|
|
- if (!SingleID.Contains(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString()))
|
|
|
- SingleID.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString());
|
|
|
-
|
|
|
- if (!MidIDAndOutboxcode.ContainsValue(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))
|
|
|
- MidIDAndOutboxcode.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString());
|
|
|
- }
|
|
|
-
|
|
|
- string[] pib_id_arr = SingleID.ToArray();
|
|
|
-
|
|
|
- List<DataTable> AllSingleBoxCacheData = new List<DataTable>();
|
|
|
-
|
|
|
-
|
|
|
- DataColumn datacolumn = new DataColumn("pib_id");
|
|
|
- if (!SingleBoxCacheData.Columns.Contains("pib_id"))
|
|
|
- SingleBoxCacheData.Columns.Add(datacolumn);
|
|
|
-
|
|
|
- try
|
|
|
+ if (PrintMethod == "CodeSoft")
|
|
|
{
|
|
|
- for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
|
|
|
+ if (SingleDoc == null)
|
|
|
+ return;
|
|
|
+ for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
{
|
|
|
-
|
|
|
- for (int k = 0; k < SingleLabelParam.Rows.Count; k++)
|
|
|
+ if (!SingleID.Contains(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString()))
|
|
|
+ SingleID.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString());
|
|
|
+
|
|
|
+ if (!MidIDAndOutboxcode.ContainsValue(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))
|
|
|
+ MidIDAndOutboxcode.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString());
|
|
|
+ }
|
|
|
+
|
|
|
+ string[] pib_id_arr = SingleID.ToArray();
|
|
|
+
|
|
|
+ List<DataTable> AllSingleBoxCacheData = new List<DataTable>();
|
|
|
+
|
|
|
+
|
|
|
+ DataColumn datacolumn = new DataColumn("pib_id");
|
|
|
+ if (!SingleBoxCacheData.Columns.Contains("pib_id"))
|
|
|
+ SingleBoxCacheData.Columns.Add(datacolumn);
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
|
|
|
{
|
|
|
- if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == SingleLabelParam.Rows[k]["lp_name"].ToString())
|
|
|
+
|
|
|
+ for (int k = 0; k < SingleLabelParam.Rows.Count; k++)
|
|
|
{
|
|
|
- DataColumn dc = new DataColumn(SingleDoc.Variables.FreeVariables.Item(j + 1).Name);
|
|
|
- SingleBoxCacheData.Columns.Add(dc);
|
|
|
- SingleBoxArgument.Add(SingleDoc.Variables.FreeVariables.Item(j + 1).Name);
|
|
|
- string sql = SingleLabelParam.Rows[k]["lp_sql"].ToString();
|
|
|
- sql = sql.Substring(0, sql.IndexOf("{"));
|
|
|
- sql = sql.Substring(0, sql.LastIndexOf("="));
|
|
|
- DataTable temp = dh.getFieldsDatasByCondition(sql.Replace(" from ", " ,pib_id PIBID from ") + " in (select pib_id from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "') ORDER by pib_id");
|
|
|
- temp.Columns[0].ColumnName = SingleDoc.Variables.FreeVariables.Item(j + 1).Name;
|
|
|
- AllSingleBoxCacheData.Add(temp);
|
|
|
+ if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == SingleLabelParam.Rows[k]["lp_name"].ToString())
|
|
|
+ {
|
|
|
+ DataColumn dc = new DataColumn(SingleDoc.Variables.FreeVariables.Item(j + 1).Name);
|
|
|
+ SingleBoxCacheData.Columns.Add(dc);
|
|
|
+ SingleBoxArgument.Add(SingleDoc.Variables.FreeVariables.Item(j + 1).Name);
|
|
|
+ string sql = SingleLabelParam.Rows[k]["lp_sql"].ToString();
|
|
|
+ sql = sql.Substring(0, sql.IndexOf("{"));
|
|
|
+ sql = sql.Substring(0, sql.LastIndexOf("="));
|
|
|
+ DataTable temp = dh.getFieldsDatasByCondition(sql.Replace(" from ", " ,pib_id PIBID from ") + " in (select pib_id from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "') ORDER by pib_id");
|
|
|
+ temp.Columns[0].ColumnName = SingleDoc.Variables.FreeVariables.Item(j + 1).Name;
|
|
|
+ AllSingleBoxCacheData.Add(temp);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- DataTable[] Temp = AllSingleBoxCacheData.ToArray();
|
|
|
-
|
|
|
- if (Temp.Length > 0)
|
|
|
- for (int i = 0; i < Temp[0].Rows.Count; i++)
|
|
|
- {
|
|
|
- DataRow dr = SingleBoxCacheData.NewRow();
|
|
|
- dr["pib_id"] = pib_id_arr[i];
|
|
|
-
|
|
|
- for (int j = 1; j < SingleBoxCacheData.Columns.Count; j++)
|
|
|
+ DataTable[] Temp = AllSingleBoxCacheData.ToArray();
|
|
|
+
|
|
|
+ if (Temp.Length > 0)
|
|
|
+ for (int i = 0; i < Temp[0].Rows.Count; i++)
|
|
|
{
|
|
|
- dr[Temp[j - 1].Columns[0].ColumnName] = (Temp[j - 1].Select("PIBID=" + pib_id_arr[i]))[0][0];
|
|
|
+ DataRow dr = SingleBoxCacheData.NewRow();
|
|
|
+ dr["pib_id"] = pib_id_arr[i];
|
|
|
+
|
|
|
+ for (int j = 1; j < SingleBoxCacheData.Columns.Count; j++)
|
|
|
+ {
|
|
|
+ dr[Temp[j - 1].Columns[0].ColumnName] = (Temp[j - 1].Select("PIBID=" + pib_id_arr[i]))[0][0];
|
|
|
+ }
|
|
|
+ SingleBoxCacheData.Rows.Add(dr);
|
|
|
}
|
|
|
- SingleBoxCacheData.Rows.Add(dr);
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
|
|
|
- SingleBoxArgument.Clear();
|
|
|
- SingleBoxCacheData.Clear();
|
|
|
- BaseUtil.CleanDataTable(SingleBoxCacheData);
|
|
|
+ SingleBoxArgument.Clear();
|
|
|
+ SingleBoxCacheData.Clear();
|
|
|
+ BaseUtil.CleanDataTable(SingleBoxCacheData);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- private void GetMidBoxData()
|
|
|
+ private void GetMidBoxData(string PrintMethod)
|
|
|
{
|
|
|
- if (MidDoc == null)
|
|
|
- return;
|
|
|
- StringBuilder pib_condition_string = new StringBuilder();
|
|
|
- StringBuilder pib_qtycondition_string = new StringBuilder();
|
|
|
- for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
+ if (PrintMethod == "CodeSoft")
|
|
|
{
|
|
|
-
|
|
|
- if (!MidIDAndOutboxcode.ContainsValue(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))
|
|
|
+ if (MidDoc == null)
|
|
|
+ return;
|
|
|
+ StringBuilder pib_condition_string = new StringBuilder();
|
|
|
+ StringBuilder pib_qtycondition_string = new StringBuilder();
|
|
|
+ for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (!MidIDAndOutboxcode.ContainsValue(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))
|
|
|
+ {
|
|
|
+ MidIDAndOutboxcode.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ string[] pib_id_arr = MidIDAndOutboxcode.Keys.ToArray();
|
|
|
+ string[] pib_outbox_arr = MidIDAndOutboxcode.Values.ToArray();
|
|
|
+ if (pib_id_arr.Length == 0)
|
|
|
{
|
|
|
- MidIDAndOutboxcode.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString());
|
|
|
+ MessageBox.Show("未勾选打印明细");
|
|
|
+ return;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- string[] pib_id_arr = MidIDAndOutboxcode.Keys.ToArray();
|
|
|
- string[] pib_outbox_arr = MidIDAndOutboxcode.Values.ToArray();
|
|
|
- if (pib_id_arr.Length == 0)
|
|
|
- {
|
|
|
- MessageBox.Show("未勾选打印明细");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- string pib_id = pib_id_arr[0];
|
|
|
-
|
|
|
-
|
|
|
- List<DataTable> AllMidBoxCacheData = new List<DataTable>();
|
|
|
-
|
|
|
-
|
|
|
- DataColumn IDColumn = new DataColumn("pib_id");
|
|
|
- DataColumn OutBoxColumn = new DataColumn("pib_outboxcode1");
|
|
|
- if (!MidBoxCacheData.Columns.Contains("pib_id"))
|
|
|
- MidBoxCacheData.Columns.Add(IDColumn);
|
|
|
- if (!MidBoxCacheData.Columns.Contains("pib_outboxcode1"))
|
|
|
- MidBoxCacheData.Columns.Add(OutBoxColumn);
|
|
|
- if (MidLabelCombox.SelectedValue == null)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- string la_id = MidLabelCombox.SelectedValue.ToString().Split('#')[0];
|
|
|
- for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
|
|
|
- {
|
|
|
-
|
|
|
- for (int k = 0; k < MidLabelParam.Rows.Count; k++)
|
|
|
+
|
|
|
+ string pib_id = pib_id_arr[0];
|
|
|
+
|
|
|
+
|
|
|
+ List<DataTable> AllMidBoxCacheData = new List<DataTable>();
|
|
|
+
|
|
|
+
|
|
|
+ DataColumn IDColumn = new DataColumn("pib_id");
|
|
|
+ DataColumn OutBoxColumn = new DataColumn("pib_outboxcode1");
|
|
|
+ if (!MidBoxCacheData.Columns.Contains("pib_id"))
|
|
|
+ MidBoxCacheData.Columns.Add(IDColumn);
|
|
|
+ if (!MidBoxCacheData.Columns.Contains("pib_outboxcode1"))
|
|
|
+ MidBoxCacheData.Columns.Add(OutBoxColumn);
|
|
|
+ if (MidLabelCombox.SelectedValue == null)
|
|
|
{
|
|
|
- if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == MidLabelParam.Rows[k]["lp_name"].ToString())
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ string la_id = MidLabelCombox.SelectedValue.ToString().Split('#')[0];
|
|
|
+ for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
|
|
|
+ {
|
|
|
+
|
|
|
+ for (int k = 0; k < MidLabelParam.Rows.Count; k++)
|
|
|
{
|
|
|
- DataColumn dc = new DataColumn(MidDoc.Variables.FreeVariables.Item(j + 1).Name);
|
|
|
- MidBoxCacheData.Columns.Add(dc);
|
|
|
- MidBoxArgument.Add(MidDoc.Variables.FreeVariables.Item(j + 1).Name);
|
|
|
- string sql = MidLabelParam.Rows[k]["lp_sql"].ToString();
|
|
|
-
|
|
|
- if (sql.ToLower().Contains("pib_qty"))
|
|
|
+ if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == MidLabelParam.Rows[k]["lp_name"].ToString())
|
|
|
{
|
|
|
- sql = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
|
|
|
- sql = sql.Substring(0, sql.LastIndexOf("=")) + " in (select distinct pib_outboxcode1 from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "')" + sql.Substring(sql.LastIndexOf("}") + 1);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- sql = sql.Substring(0, sql.IndexOf("{"));
|
|
|
- sql = sql.Substring(0, sql.LastIndexOf("="));
|
|
|
- sql = sql + " in (select distinct pib_outboxcode1 from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "')" + " and pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode1)";
|
|
|
+ DataColumn dc = new DataColumn(MidDoc.Variables.FreeVariables.Item(j + 1).Name);
|
|
|
+ MidBoxCacheData.Columns.Add(dc);
|
|
|
+ MidBoxArgument.Add(MidDoc.Variables.FreeVariables.Item(j + 1).Name);
|
|
|
+ string sql = MidLabelParam.Rows[k]["lp_sql"].ToString();
|
|
|
+
|
|
|
+ if (sql.ToLower().Contains("pib_qty"))
|
|
|
+ {
|
|
|
+ sql = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
|
|
|
+ sql = sql.Substring(0, sql.LastIndexOf("=")) + " in (select distinct pib_outboxcode1 from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "')" + sql.Substring(sql.LastIndexOf("}") + 1);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sql = sql.Substring(0, sql.IndexOf("{"));
|
|
|
+ sql = sql.Substring(0, sql.LastIndexOf("="));
|
|
|
+ sql = sql + " in (select distinct pib_outboxcode1 from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "')" + " and pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode1)";
|
|
|
+ }
|
|
|
+ DataTable temp = dh.getFieldsDatasByCondition(sql);
|
|
|
+ temp.Columns[0].ColumnName = MidDoc.Variables.FreeVariables.Item(j + 1).Name;
|
|
|
+ AllMidBoxCacheData.Add(temp);
|
|
|
}
|
|
|
- DataTable temp = dh.getFieldsDatasByCondition(sql);
|
|
|
- temp.Columns[0].ColumnName = MidDoc.Variables.FreeVariables.Item(j + 1).Name;
|
|
|
- AllMidBoxCacheData.Add(temp);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- DataTable[] Temp = AllMidBoxCacheData.ToArray();
|
|
|
-
|
|
|
- if (Temp.Length > 0)
|
|
|
- {
|
|
|
- for (int i = 0; i < pib_id_arr.Length; i++)
|
|
|
+ DataTable[] Temp = AllMidBoxCacheData.ToArray();
|
|
|
+
|
|
|
+ if (Temp.Length > 0)
|
|
|
{
|
|
|
- DataRow dr = MidBoxCacheData.NewRow();
|
|
|
- dr["pib_id"] = pib_id_arr[i];
|
|
|
- dr["pib_outboxcode1"] = pib_outbox_arr[i];
|
|
|
-
|
|
|
- for (int j = 2; j < MidBoxCacheData.Columns.Count; j++)
|
|
|
+ for (int i = 0; i < pib_id_arr.Length; i++)
|
|
|
{
|
|
|
-
|
|
|
- dr[Temp[j - 2].Columns[0].ColumnName] = Temp[j - 2].Select("PIB_OUTBOXCODE1='" + pib_outbox_arr[i] + "'")[0][0];
|
|
|
+ DataRow dr = MidBoxCacheData.NewRow();
|
|
|
+ dr["pib_id"] = pib_id_arr[i];
|
|
|
+ dr["pib_outboxcode1"] = pib_outbox_arr[i];
|
|
|
+
|
|
|
+ for (int j = 2; j < MidBoxCacheData.Columns.Count; j++)
|
|
|
+ {
|
|
|
+
|
|
|
+ dr[Temp[j - 2].Columns[0].ColumnName] = Temp[j - 2].Select("PIB_OUTBOXCODE1='" + pib_outbox_arr[i] + "'")[0][0];
|
|
|
+ }
|
|
|
+ MidBoxCacheData.Rows.Add(dr);
|
|
|
}
|
|
|
- MidBoxCacheData.Rows.Add(dr);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1557,7 +1568,7 @@ namespace UAS_LabelMachine
|
|
|
MidOutBoxCodeIndex.Add(i);
|
|
|
}
|
|
|
}
|
|
|
- GetMidBoxData();
|
|
|
+ GetMidBoxData(PrintMethod);
|
|
|
for (int i = 0; i < MidOutBoxCodeIndex.Count; i++)
|
|
|
{
|
|
|
MidBoxCodePrint(MidOutBoxCodeIndex[i]);
|
|
@@ -1689,7 +1700,7 @@ namespace UAS_LabelMachine
|
|
|
if (MidBoxCacheData.Rows.Count == 0)
|
|
|
{
|
|
|
MidIDAndOutboxcode.Add(LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString());
|
|
|
- GetMidBoxData();
|
|
|
+ GetMidBoxData(PrintMethod);
|
|
|
}
|
|
|
string[] arg = MidBoxArgument.ToArray();
|
|
|
|
|
@@ -1710,6 +1721,8 @@ namespace UAS_LabelMachine
|
|
|
string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
|
|
|
if (PrintMethod == "CodeSoft")
|
|
|
Print.CodeSoft.OutPrint(OutBoxDoc, OutLabelParam, pib_id, pib_outboxcode2);
|
|
|
+ else
|
|
|
+ Print.BarTender.OutPrint();
|
|
|
}
|
|
|
catch (Exception ex) { MessageBox.Show(ex.Message); }
|
|
|
}
|