|
@@ -214,6 +214,15 @@ namespace UAS_LabelMachine
|
|
|
port.Read(readBuffer, 0, len); //将数据读入缓存
|
|
port.Read(readBuffer, 0, len); //将数据读入缓存
|
|
|
string msg = Encoding.ASCII.GetString(readBuffer, 0, len); //获取出入库产品编号
|
|
string msg = Encoding.ASCII.GetString(readBuffer, 0, len); //获取出入库产品编号
|
|
|
string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
|
|
|
+ int pib_pdno = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["pib_pdno"].Value.ToString());
|
|
|
|
|
+ if (DetailRange.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ //不在范围内的不进行处理
|
|
|
|
|
+ if (!(pib_pdno >= DetailRange1.Value && pib_pdno <= DetailRange2.Value))
|
|
|
|
|
+ {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
switch (port.Tag)
|
|
switch (port.Tag)
|
|
|
{
|
|
{
|
|
|
case "FrontendCheck":
|
|
case "FrontendCheck":
|
|
@@ -264,11 +273,11 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
{
|
|
|
DateCode = matchs[index].Value;
|
|
DateCode = matchs[index].Value;
|
|
|
}
|
|
}
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value = DateCode;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[CurrentRowIndex]["pib_datecode"] = DateCode;
|
|
|
break;
|
|
break;
|
|
|
case "LotNo":
|
|
case "LotNo":
|
|
|
LotNo = matchs[index].Value;
|
|
LotNo = matchs[index].Value;
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value = LotNo;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[CurrentRowIndex]["pib_lotno"] = LotNo;
|
|
|
break;
|
|
break;
|
|
|
case "PN":
|
|
case "PN":
|
|
|
PN = matchs[index].Value;
|
|
PN = matchs[index].Value;
|
|
@@ -298,12 +307,14 @@ namespace UAS_LabelMachine
|
|
|
LabelInf.Refresh();
|
|
LabelInf.Refresh();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[CurrentRowIndex]["pib_ifpick"] = true;
|
|
|
LabelInf.Refresh();
|
|
LabelInf.Refresh();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void BackendCheckFunction(string msg, string pib_id)
|
|
private void BackendCheckFunction(string msg, string pib_id)
|
|
|
{
|
|
{
|
|
|
|
|
+ Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff"));
|
|
|
|
|
+ DataTable dtt = LabelInf.DataSource as DataTable;
|
|
|
string[] msgArr = msg.Split('@');
|
|
string[] msgArr = msg.Split('@');
|
|
|
//需要校验2项数据,完成校验后此项的值需要为2则表示校验成功
|
|
//需要校验2项数据,完成校验后此项的值需要为2则表示校验成功
|
|
|
int checkItemCount = 0;
|
|
int checkItemCount = 0;
|
|
@@ -350,7 +361,7 @@ namespace UAS_LabelMachine
|
|
|
MessageBox.Show("复核不通过");
|
|
MessageBox.Show("复核不通过");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_ifrecheck"].Value = true;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[CurrentRowIndex]["pib_ifrecheck"] = true;
|
|
|
adh.ExecuteSql("update prodiobarcode set pib_ifrecheck=-1 where pib_id=" + pib_id, "update");
|
|
adh.ExecuteSql("update prodiobarcode set pib_ifrecheck=-1 where pib_id=" + pib_id, "update");
|
|
|
LabelInf.Refresh();
|
|
LabelInf.Refresh();
|
|
|
//获取当前最大的箱号
|
|
//获取当前最大的箱号
|
|
@@ -389,14 +400,26 @@ namespace UAS_LabelMachine
|
|
|
outboxcode1 = outboxcode1 + 1;
|
|
outboxcode1 = outboxcode1 + 1;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = outboxcode2;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[CurrentRowIndex]["pib_outboxcode1"] = outboxcode1;
|
|
|
|
|
+ LabelInfDataTable.Rows[CurrentRowIndex]["pib_outboxcode2"] = outboxcode2;
|
|
|
adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
|
|
adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
|
|
|
LabelInf.Refresh();
|
|
LabelInf.Refresh();
|
|
|
if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
|
|
if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
|
|
|
CurrentRowIndex = CurrentRowIndex + 1;
|
|
CurrentRowIndex = CurrentRowIndex + 1;
|
|
|
RefreshProcessData();
|
|
RefreshProcessData();
|
|
|
- LogicHandler.CheckUploadData(pi_inoutno.Text, UploadNum);
|
|
|
|
|
|
|
+ if (CurrentRowIndex - 10 > 0)
|
|
|
|
|
+ LabelInf.FirstDisplayedScrollingRowIndex = CurrentRowIndex - 10;
|
|
|
|
|
+ //如果成功上传了数据
|
|
|
|
|
+ if (LogicHandler.CheckUploadData(pi_inoutno.Text, UploadNum))
|
|
|
|
|
+ {
|
|
|
|
|
+ for (int i = 0; i < dtt.Rows.Count; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (dtt.Rows[i]["pib_ifrecheck"].ToString() != "0" && dtt.Rows[i]["pib_ifupload"].ToString() == "0")
|
|
|
|
|
+ {
|
|
|
|
|
+ dtt.Rows[i]["pib_ifupload"] = -1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//只执行一次窗体自适应
|
|
//只执行一次窗体自适应
|
|
@@ -459,10 +482,9 @@ namespace UAS_LabelMachine
|
|
|
if (CollectVeProdCodePass && CollectQTYPass)
|
|
if (CollectVeProdCodePass && CollectQTYPass)
|
|
|
{
|
|
{
|
|
|
//如果按盒号采集,所有的此盒的均更新为
|
|
//如果按盒号采集,所有的此盒的均更新为
|
|
|
- DataTable dt = (DataTable)MidSource.DataSource;
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[CurrentRowIndex]["pib_ifpick"] = true;
|
|
|
LogicHandler.UpdateRowPicked(LabelInf.Rows[CurrentRowIndex].Cells["pib_id"].Value);
|
|
LogicHandler.UpdateRowPicked(LabelInf.Rows[CurrentRowIndex].Cells["pib_id"].Value);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["Choose"].Value = true;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[CurrentRowIndex]["Choose"] = true;
|
|
|
//勾选了单盘自动打印
|
|
//勾选了单盘自动打印
|
|
|
if (SingleLabelAutoPrint.Checked)
|
|
if (SingleLabelAutoPrint.Checked)
|
|
|
{
|
|
{
|
|
@@ -517,7 +539,7 @@ namespace UAS_LabelMachine
|
|
|
SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
|
SingleDoc.PrintDocument();
|
|
SingleDoc.PrintDocument();
|
|
|
LogicHandler.UpdateRowPrinted(pib_id);
|
|
LogicHandler.UpdateRowPrinted(pib_id);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_ifprint"].Value = true;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[CurrentRowIndex]["pib_ifprint"] = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//关闭窗口前提示用户确认
|
|
//关闭窗口前提示用户确认
|
|
@@ -841,7 +863,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//勾选为已打印
|
|
//勾选为已打印
|
|
|
- LabelInf.Rows[i].Cells["pib_ifprint"].Value = true;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[i]["pib_ifprint"] = true;
|
|
|
}
|
|
}
|
|
|
catch (Exception ex) { LogManager.DoLog(ex.Message); }
|
|
catch (Exception ex) { LogManager.DoLog(ex.Message); }
|
|
|
}
|
|
}
|
|
@@ -874,9 +896,9 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
{
|
|
|
for (int i = begin - 1; i < end; i++)
|
|
for (int i = begin - 1; i < end; i++)
|
|
|
{
|
|
{
|
|
|
- LabelInf.Rows[i].Cells["Choose"].Value = true;
|
|
|
|
|
- LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
|
|
|
|
|
- LabelInf.Rows[i].Cells["pib_ifprint"].Value = false;
|
|
|
|
|
|
|
+ LabelInfDataTable.Rows[i]["Choose"] = true;
|
|
|
|
|
+ LabelInfDataTable.Rows[i]["pib_ifpick"] = true;
|
|
|
|
|
+ LabelInfDataTable.Rows[i]["pib_ifprint"] = false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
@@ -1169,7 +1191,7 @@ namespace UAS_LabelMachine
|
|
|
if (LabelInf.Rows.Count > 0)
|
|
if (LabelInf.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
//设置初始化的采集进度
|
|
//设置初始化的采集进度
|
|
|
- int Count = 0;
|
|
|
|
|
|
|
+ int Count = Count = adh.getRowCount("prodiobarcode", "pib_ifrecheck=-1");
|
|
|
string midboxcode = "";
|
|
string midboxcode = "";
|
|
|
string outboxcode = "";
|
|
string outboxcode = "";
|
|
|
if (CurrentRowIndex - 1 >= 0)
|
|
if (CurrentRowIndex - 1 >= 0)
|
|
@@ -1178,11 +1200,6 @@ namespace UAS_LabelMachine
|
|
|
midboxcode = LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_outboxcode1"].Value.ToString();
|
|
midboxcode = LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_outboxcode1"].Value.ToString();
|
|
|
}
|
|
}
|
|
|
//未超出当前范围的时候
|
|
//未超出当前范围的时候
|
|
|
- for (int i = 0; i < LabelInf.RowCount; i++)
|
|
|
|
|
- {
|
|
|
|
|
- if (LabelInf.Rows[i].Cells["pib_ifrecheck"].FormattedValue.ToString() == "True")
|
|
|
|
|
- Count++;
|
|
|
|
|
- }
|
|
|
|
|
int midboxcount = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (midboxcode == "" ? "0" : midboxcode));
|
|
int midboxcount = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (midboxcode == "" ? "0" : midboxcode));
|
|
|
int outboxcount = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + (outboxcode == "" ? "0" : outboxcode));
|
|
int outboxcount = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + (outboxcode == "" ? "0" : outboxcode));
|
|
|
midboxProcess.Text = midboxcount + "/" + MidBoxCapacity.Value;
|
|
midboxProcess.Text = midboxcount + "/" + MidBoxCapacity.Value;
|
|
@@ -1191,7 +1208,7 @@ namespace UAS_LabelMachine
|
|
|
Process_midboxcode.Text = midboxcode;
|
|
Process_midboxcode.Text = midboxcode;
|
|
|
Process_outboxcode.Text = outboxcode;
|
|
Process_outboxcode.Text = outboxcode;
|
|
|
//设置当前总数和已采集数量
|
|
//设置当前总数和已采集数量
|
|
|
- CollectedCount.Text = Count.ToString() + "/" + LabelInf.Rows.Count;
|
|
|
|
|
|
|
+ CollectedCount.Text = Count + "/" + PageNum.Text;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1203,6 +1220,7 @@ namespace UAS_LabelMachine
|
|
|
int PageSize = 1000;
|
|
int PageSize = 1000;
|
|
|
int DataSize = 0;
|
|
int DataSize = 0;
|
|
|
int MaxPageSize = 0;
|
|
int MaxPageSize = 0;
|
|
|
|
|
+ DataTable LabelInfDataTable;
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 自定义函数 加载明细行的数据,多处使用添加进函数
|
|
/// 自定义函数 加载明细行的数据,多处使用添加进函数
|
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -1210,27 +1228,50 @@ namespace UAS_LabelMachine
|
|
|
/// <param name="e"></param>
|
|
/// <param name="e"></param>
|
|
|
private void LoadGridData(object sender, EventArgs e)
|
|
private void LoadGridData(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
|
- dt = (DataTable)adh.ExecuteSql("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum between " + ((CurrentPage - 1) * PageSize + 1) + " and " + CurrentPage * PageSize + " order by rownum", "select");
|
|
|
|
|
- if (dt.Rows.Count == 0)
|
|
|
|
|
|
|
+ sql.Clear();
|
|
|
|
|
+ sql.Append("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum ");
|
|
|
|
|
+ sql.Append("between " + ((CurrentPage - 1) * PageSize + 1) + " and " + CurrentPage * PageSize + " ");
|
|
|
|
|
+ if (DetailRange.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ sql.Append(" and pib_pdno between " + DetailRange1.Value + " and " + DetailRange2.Value);
|
|
|
|
|
+ }
|
|
|
|
|
+ sql.Append(" order by rownum");
|
|
|
|
|
+ LabelInfDataTable = (DataTable)adh.ExecuteSql(sql.ToString(), "select");
|
|
|
|
|
+ if (LabelInfDataTable.Rows.Count == 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ //嵌套查询重置RowNum
|
|
|
sql.Clear();
|
|
sql.Clear();
|
|
|
- sql.Append("select rownum,pd_custprodcode,pib_inoutno,pd_custprodspec,nvl(pib_ifrecheck,0)pib_ifrecheck,nvl(pib_ifupload,0)pib_ifupload,nvl(pib_ifmodify,0)pib_ifmodify,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,");
|
|
|
|
|
|
|
+ sql.Append("select t.*,rownum from (select pd_custprodcode,pib_inoutno,pd_custprodspec,nvl(pib_ifrecheck,0)pib_ifrecheck,nvl(pib_ifupload,0)pib_ifupload,nvl(pib_ifmodify,0)pib_ifmodify,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,");
|
|
|
sql.Append("pib_id,pib_pdid,pib_piid,pib_pdno,pib_prodcode,nvl(nvl(pd_brand,pib_brand),pr_brand)pib_brand, pr_vendprodcode,pib_lotno,pib_datecode,pib_qty,pr_spec,pi_title,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,");
|
|
sql.Append("pib_id,pib_pdid,pib_piid,pib_pdno,pib_prodcode,nvl(nvl(pd_brand,pib_brand),pr_brand)pib_brand, pr_vendprodcode,pib_lotno,pib_datecode,pib_qty,pr_spec,pi_title,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,");
|
|
|
sql.Append("pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint from prodiobarcode left join prodinout on pib_piid=pi_id left join prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and ");
|
|
sql.Append("pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint from prodiobarcode left join prodinout on pib_piid=pi_id left join prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and ");
|
|
|
- sql.Append("pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode where pib_piid='" + PI_ID + "' order by rownum");
|
|
|
|
|
- dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
|
|
|
|
+ sql.Append("pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode where pib_piid='" + PI_ID + "' order by to_number(pib_id))t");
|
|
|
|
|
+ LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
//检验查询的字段和本地数据库字段是否匹配
|
|
//检验查询的字段和本地数据库字段是否匹配
|
|
|
- adh.AddColumFromDataTable(dt, "prodiobarcode");
|
|
|
|
|
|
|
+ adh.AddColumFromDataTable(LabelInfDataTable, "prodiobarcode");
|
|
|
//将数据保存在本地数据库
|
|
//将数据保存在本地数据库
|
|
|
- adh.SaveDataTable(dt, "prodiobarcode");
|
|
|
|
|
- dt = BaseUtil.filterDataTable(dt, "rownum <=" + PageSize);
|
|
|
|
|
|
|
+ adh.SaveDataTable(LabelInfDataTable, "prodiobarcode");
|
|
|
|
|
+ if (!DetailRange.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ LabelInfDataTable = BaseUtil.filterDataTable(LabelInfDataTable, "rownum <=" + PageSize);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ LabelInfDataTable = BaseUtil.filterDataTable(LabelInfDataTable, "rownum <=" + PageSize + " and pib_pdno >= " + DetailRange1.Value + " and pib_pdno<=" + DetailRange2.Value);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //获取数据总条数
|
|
|
|
|
+ if (!DetailRange.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ DataSize = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "'");
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ DataSize = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno between " + DetailRange1.Value + " and " + DetailRange2.Value);
|
|
|
}
|
|
}
|
|
|
- DataSize = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "'");
|
|
|
|
|
PageNum.Text = "总数" + DataSize;
|
|
PageNum.Text = "总数" + DataSize;
|
|
|
MaxPageSize = DataSize % PageSize == 0 ? DataSize / PageSize : (DataSize / PageSize) + 1;
|
|
MaxPageSize = DataSize % PageSize == 0 ? DataSize / PageSize : (DataSize / PageSize) + 1;
|
|
|
PageInf.Text = CurrentPage + "/" + MaxPageSize;
|
|
PageInf.Text = CurrentPage + "/" + MaxPageSize;
|
|
|
- MidSource.DataSource = dt;
|
|
|
|
|
- BaseUtil.FillDgvWithDataTable(LabelInf, (DataTable)MidSource.DataSource);
|
|
|
|
|
|
|
+ BaseUtil.FillDgvWithDataTable(LabelInf, LabelInfDataTable);
|
|
|
//获取系统设置的上传数量,如参数异常则默认为100
|
|
//获取系统设置的上传数量,如参数异常则默认为100
|
|
|
dt = (DataTable)adh.ExecuteSql("select uploadnum,splitback,splitfront from dataextra", "select");
|
|
dt = (DataTable)adh.ExecuteSql("select uploadnum,splitback,splitfront from dataextra", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
if (dt.Rows.Count > 0)
|
|
@@ -1450,7 +1491,7 @@ namespace UAS_LabelMachine
|
|
|
if (result == DialogResult.OK)
|
|
if (result == DialogResult.OK)
|
|
|
{
|
|
{
|
|
|
ExcelHandler eh = new ExcelHandler();
|
|
ExcelHandler eh = new ExcelHandler();
|
|
|
- DataTable dt = ((DataTable)MidSource.DataSource).Copy();
|
|
|
|
|
|
|
+ DataTable dt = LabelInfDataTable;
|
|
|
for (int i = dt.Columns.Count - 1; i >= 0; i--)
|
|
for (int i = dt.Columns.Count - 1; i >= 0; i--)
|
|
|
{
|
|
{
|
|
|
for (int j = 0; j < LabelInf.Columns.Count; j++)
|
|
for (int j = 0; j < LabelInf.Columns.Count; j++)
|
|
@@ -1598,6 +1639,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
}
|
|
|
DetailRange1.Enabled = false;
|
|
DetailRange1.Enabled = false;
|
|
|
DetailRange2.Enabled = false;
|
|
DetailRange2.Enabled = false;
|
|
|
|
|
+ LoadGridData();
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -1608,7 +1650,16 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
|
|
private void PLCStart_Click(object sender, EventArgs e)
|
|
private void PLCStart_Click(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+ DataTable dt = (DataTable)adh.ExecuteSql("select * from cominfo", "select");
|
|
|
|
|
+ DataRow[] dr = dt.Select("comtype='PLC1'");
|
|
|
|
|
+ if (dr.Length > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ PLC1.PortName = dr[0]["COM"].ToString();
|
|
|
|
|
+ PLC1.Tag = "FrontendCheck";
|
|
|
|
|
+ PLC1.BaudRate = int.Parse(dr[0]["BaudRate"].ToString());
|
|
|
|
|
+ PLC1.DataReceived += Serial_DataReceived;
|
|
|
|
|
+ PLC1.Open();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void PLCStop_Click(object sender, EventArgs e)
|
|
private void PLCStop_Click(object sender, EventArgs e)
|
|
@@ -1618,12 +1669,16 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
|
|
private void ButtonCollectPass_Click(object sender, EventArgs e)
|
|
private void ButtonCollectPass_Click(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+ string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
|
|
|
+ int pib_pdno = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["pib_pdno"].Value.ToString());
|
|
|
|
|
+ FrontCheckFunction("");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void ButtonRecheckPass_Click(object sender, EventArgs e)
|
|
private void ButtonRecheckPass_Click(object sender, EventArgs e)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+ string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
|
|
|
+ int pib_pdno = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["pib_pdno"].Value.ToString());
|
|
|
|
|
+ BackendCheckFunction("", pib_id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void ButtonSetMidBox_Click(object sender, EventArgs e)
|
|
private void ButtonSetMidBox_Click(object sender, EventArgs e)
|