|
|
@@ -306,12 +306,9 @@ namespace UAS_LabelMachine
|
|
|
/// <param name="e"></param>
|
|
|
private void SaveGrid_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- DataTable savedt = (LabelInf.DataSource as DataTable);
|
|
|
- if (savedt != null && savedt.GetChanges() != null)
|
|
|
- {
|
|
|
- dh.SaveDataTable(savedt.GetChanges(), "ProdioBarCode", "pib_id");
|
|
|
- MessageBox.Show("保存成功!");
|
|
|
- }
|
|
|
+ DataTable dt = (DataTable)sdh.ExecuteSql("select pib_id,pib_outboxcode1,pib_outboxcode2,pib_custmidboxcode,pib_custoutboxcode,pib_lotno,pib_datecode,pib_ifupload,pib_ifpick,pib_ifprint from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_ifpick=-1 ", "select");
|
|
|
+ dh.CallProcedure("sp_uploadbarcode", dt);
|
|
|
+ MessageBox.Show("保存成功!");
|
|
|
}
|
|
|
|
|
|
//放大镜选择后出发的事件
|
|
|
@@ -1585,7 +1582,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
//检验查询的字段和本地数据库字段是否匹配
|
|
|
sdh.AddColumFromDataTable(LabelInfDataTable, "prodiobarcode");
|
|
|
- sdh.BatchInsert("prodiobarcode", LabelInfDataTable);
|
|
|
+ //sdh.BatchInsert("prodiobarcode", LabelInfDataTable);
|
|
|
}
|
|
|
sql.Clear();
|
|
|
sql.Append("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by rownum ");
|
|
|
@@ -2231,7 +2228,7 @@ namespace UAS_LabelMachine
|
|
|
result = ExportFileDialog.ShowDialog();
|
|
|
if (result == DialogResult.OK)
|
|
|
{
|
|
|
- File.Copy(System.Windows.Forms.Application.StartupPath+ "\\导入模板.xlsx", ExportFileDialog.SelectedPath+ "\\导入模板.xlsx",true);
|
|
|
+ File.Copy(System.Windows.Forms.Application.StartupPath + "\\导入模板.xlsx", ExportFileDialog.SelectedPath + "\\导入模板.xlsx", true);
|
|
|
System.Diagnostics.Process.Start(ExportFileDialog.SelectedPath + "\\导入模板.xlsx");
|
|
|
}
|
|
|
break;
|
|
|
@@ -2352,17 +2349,17 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
custserialnum = int.Parse(maxnum);
|
|
|
}
|
|
|
- dt = ExcelHandler.ExcelToDataTable(ImportExcel.FileName, true);
|
|
|
+ DataTable dt = ExcelHandler.ExcelToDataTable(ImportExcel.FileName, true);
|
|
|
if (dt == null)
|
|
|
{
|
|
|
MessageBox.Show("文件" + ImportExcel.FileName + "被占用");
|
|
|
return;
|
|
|
}
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pr_orispeccode,pd_outqty,pr_id,pd_piclass,pd_piid,pd_id,pr_zxbzs,pr_brand,pd_pdno");
|
|
|
- sql.Append(",pd_prodcode,pd_ordercode,pd_orderdetno from prodiodetail left join product on pd_prodcode=pr_code ");
|
|
|
- sql.Append("where pd_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode,pd_outqty,");
|
|
|
- sql.Append("pr_id,pd_piclass,pd_piid,pd_id,pr_zxbzs,pr_brand,pd_pdno,pd_id,pd_prodcode,pd_ordercode,pd_orderdetno");
|
|
|
+ sql.Append("select pr_orispeccode,pd_outqty-nvl(sum(pib_qty),0) pd_outqty,pr_id,pd_piclass,pd_piid,pd_id,pr_zxbzs,pr_brand,pd_pdno,");
|
|
|
+ sql.Append("pd_prodcode,pd_ordercode,pd_orderdetno from prodiodetail left join product on pd_prodcode=pr_code left join prodiobarcode ");
|
|
|
+ sql.Append("on pd_id=pib_pdid where pd_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode,pd_outqty,");
|
|
|
+ sql.Append("pr_id,pd_piclass,pd_piid,pd_id,pr_zxbzs,pr_brand,pd_pdno,pd_id,pd_prodcode,pd_ordercode,pd_orderdetno order by pd_pdno");
|
|
|
DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
//需要插入的参数
|
|
|
ArrayList<string> barcode = new ArrayList<string>();
|
|
|
@@ -2379,6 +2376,36 @@ namespace UAS_LabelMachine
|
|
|
ArrayList<string> pdprodcode = new ArrayList<string>();
|
|
|
//用于数量的校验
|
|
|
Dictionary<string, decimal> sumqty = new Dictionary<string, decimal>();
|
|
|
+ Dictionary<string, Dictionary<string, decimal>> outsumqty = new Dictionary<string, Dictionary<string, decimal>>();
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ string pr_orispeccode = dt.Rows[i]["规格型号"].ToString();
|
|
|
+ string qty = dt.Rows[i]["数量"].ToString();
|
|
|
+ //累计Excel该型号的数量
|
|
|
+ if (!sumqty.ContainsKey(pr_orispeccode))
|
|
|
+ {
|
|
|
+ sumqty.Add(pr_orispeccode, 0);
|
|
|
+ }
|
|
|
+ //累计Excel该型号的数量
|
|
|
+ sumqty[pr_orispeccode] += decimal.Parse(qty);
|
|
|
+ }
|
|
|
+ for (int i = 0; i < dt1.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ //不包含型号则进行添加
|
|
|
+ string pr_orispeccode = dt1.Rows[i]["pr_orispeccode"].ToString();
|
|
|
+ string pd_pdno = dt1.Rows[i]["pd_pdno"].ToString();
|
|
|
+ decimal pd_outqty = decimal.Parse(dt1.Rows[i]["pd_outqty"].ToString());
|
|
|
+ if (!outsumqty.ContainsKey(pr_orispeccode))
|
|
|
+ {
|
|
|
+ Dictionary<string, decimal> dic = new Dictionary<string, decimal>();
|
|
|
+ dic.Add(pd_pdno, pd_outqty);
|
|
|
+ outsumqty.Add(pr_orispeccode, dic);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ outsumqty[pr_orispeccode].Add(pd_pdno, pd_outqty);
|
|
|
+ }
|
|
|
+ }
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
string pr_orispeccode = dt.Rows[i]["规格型号"].ToString();
|
|
|
@@ -2387,8 +2414,11 @@ namespace UAS_LabelMachine
|
|
|
string LotNo = "";
|
|
|
if (dt.Columns.Contains("DC/LOT NO"))
|
|
|
{
|
|
|
- DateCode = dt.Rows[i]["DC/LOT NO"].ToString().Split('-')[0];
|
|
|
- LotNo = dt.Rows[i]["DC/LOT NO"].ToString().Split('-')[1];
|
|
|
+ if (dt.Rows[i]["DC/LOT NO"].ToString().IndexOf("-") > 0)
|
|
|
+ {
|
|
|
+ DateCode = dt.Rows[i]["DC/LOT NO"].ToString().Split('-')[0];
|
|
|
+ LotNo = dt.Rows[i]["DC/LOT NO"].ToString().Split('-')[1];
|
|
|
+ }
|
|
|
}
|
|
|
if (dt.Columns.Contains("DC"))
|
|
|
{
|
|
|
@@ -2409,31 +2439,41 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
LogicHandler.FilterData(cu_code.Text, dr[0]["pr_brand"].ToString(), pr_orispeccode, qty, DateCode, LotNo, out pr_orispeccode, out qty, out DateCode, out LotNo);
|
|
|
}
|
|
|
- if (dr.Length > 0)
|
|
|
+ decimal outqty = decimal.Parse(Regex.Replace(qty, @"[^\d]*", ""));
|
|
|
+ for (int k = 0; k < dr.Length; k++)
|
|
|
{
|
|
|
- string pd_orderdetno = dr[0]["pd_orderdetno"].ToString();
|
|
|
- string pd_prodcode = dr[0]["pd_prodcode"].ToString();
|
|
|
- string pd_ordercode = dr[0]["pd_ordercode"].ToString();
|
|
|
- string pd_piid = dr[0]["pd_piid"].ToString();
|
|
|
- string pr_brand = dr[0]["pr_brand"].ToString();
|
|
|
- string pd_pdno = dr[0]["pd_pdno"].ToString();
|
|
|
- string pd_id = dr[0]["pd_id"].ToString();
|
|
|
- string pd_piclass = dr[0]["pd_piclass"].ToString();
|
|
|
- string pr_id = dr[0]["pr_id"].ToString();
|
|
|
+ string pd_orderdetno = dr[k]["pd_orderdetno"].ToString();
|
|
|
+ string pd_prodcode = dr[k]["pd_prodcode"].ToString();
|
|
|
+ string pd_ordercode = dr[k]["pd_ordercode"].ToString();
|
|
|
+ string pd_piid = dr[k]["pd_piid"].ToString();
|
|
|
+ string pr_brand = dr[k]["pr_brand"].ToString();
|
|
|
+ string pd_pdno = dr[k]["pd_pdno"].ToString();
|
|
|
+ string pd_id = dr[k]["pd_id"].ToString();
|
|
|
+ string pd_piclass = dr[k]["pd_piclass"].ToString();
|
|
|
+ string pr_id = dr[k]["pr_id"].ToString();
|
|
|
//已导入数量
|
|
|
- decimal zxbzs = decimal.Parse(dr[0]["pr_zxbzs"].ToString());
|
|
|
- decimal outqty = decimal.Parse(Regex.Replace(qty, @"[^\d]*", ""));
|
|
|
+ decimal zxbzs = decimal.Parse(dr[k]["pr_zxbzs"].ToString());
|
|
|
+ decimal pd_outqty = 0;
|
|
|
decimal barcodenum = 0;
|
|
|
- if (!sumqty.ContainsKey(pr_orispeccode))
|
|
|
+ if (outsumqty[pr_orispeccode][pd_pdno] == 0)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //如果导入行的数量小于改明细的出货数量
|
|
|
+ if (outsumqty[pr_orispeccode][pd_pdno] >= outqty)
|
|
|
+ {
|
|
|
+ //使用导入明细行数量
|
|
|
+ pd_outqty = outqty;
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- sumqty.Add(pr_orispeccode, 0);
|
|
|
+ ////使用该出货单明细行数量,并且数量置为0
|
|
|
+ pd_outqty = outsumqty[pr_orispeccode][pd_pdno];
|
|
|
}
|
|
|
- //累计Excel该型号的数量
|
|
|
- sumqty[pr_orispeccode] += decimal.Parse(qty);
|
|
|
string pib_barcode = dh.getFieldDataByCondition("prodiobarcode", "max(pib_barcode)", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
|
|
|
- if (outqty % zxbzs != 0)
|
|
|
+ if (pd_outqty % zxbzs != 0)
|
|
|
{
|
|
|
- barcodenum = Math.Floor(outqty / zxbzs) + 1;
|
|
|
+ barcodenum = Math.Floor(pd_outqty / zxbzs) + 1;
|
|
|
//如果有余数先加上所有最小包最后加尾数
|
|
|
for (int j = 0; j < barcodenum - 1; j++)
|
|
|
{
|
|
|
@@ -2452,7 +2492,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
|
|
|
barcode.Add(BaseUtil.BarcodeMethod1(pd_id, pr_id, pib_barcode));
|
|
|
- pib_inqty.Add(outqty % zxbzs);
|
|
|
+ pib_inqty.Add(pd_outqty % zxbzs);
|
|
|
piboutboxcode2.Add(pib_outboxcode2);
|
|
|
datecode.Add(DateCode);
|
|
|
lotno.Add(LotNo);
|
|
|
@@ -2465,7 +2505,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- barcodenum = outqty / zxbzs;
|
|
|
+ barcodenum = pd_outqty / zxbzs;
|
|
|
for (int j = 0; j < barcodenum; j++)
|
|
|
{
|
|
|
barcode.Add(BaseUtil.BarcodeMethod1(pd_id, pr_id, pib_barcode));
|
|
|
@@ -2482,14 +2522,16 @@ namespace UAS_LabelMachine
|
|
|
pdprodcode.Add(pd_prodcode);
|
|
|
}
|
|
|
}
|
|
|
+ outqty -= outsumqty[pr_orispeccode][pd_pdno];
|
|
|
+ outsumqty[pr_orispeccode][pd_pdno] -= pd_outqty;
|
|
|
}
|
|
|
}
|
|
|
//插叙所有的统计数量
|
|
|
string ErrMsg = "";
|
|
|
foreach (var item in sumqty)
|
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select nvl(sum(pd_outqty),0)pd_outqty,pr_orispeccode from prodiodetail left join product on pr_code=pd_prodcode where pd_piid=" + PI_ID + "group by pr_orispeccode", "select");
|
|
|
- dt1 = (DataTable)dh.ExecuteSql("select nvl(sum(pib_qty),0)pib_qty,pr_orispeccode from prodiobarcode left join product on pib_prodcode=pr_code where pib_piid=" + PI_ID + " group by pr_orispeccode", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select nvl(sum(pd_outqty),0)pd_outqty,pr_orispeccode from prodiodetail left join product on pr_code=pd_prodcode where pd_piid='" + PI_ID + "' group by pr_orispeccode", "select");
|
|
|
+ dt1 = (DataTable)dh.ExecuteSql("select nvl(sum(pib_qty),0)pib_qty,pr_orispeccode from prodiobarcode left join product on pib_prodcode=pr_code where pib_piid='" + PI_ID + "' group by pr_orispeccode", "select");
|
|
|
DataRow[] dr = dt.Select("pr_orispeccode='" + item.Key + "'");
|
|
|
DataRow[] dr1 = dt1.Select("pr_orispeccode='" + item.Key + "'");
|
|
|
if (dr.Length > 0)
|
|
|
@@ -2510,16 +2552,23 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
if (ErrMsg == "")
|
|
|
{
|
|
|
- sql.Clear();
|
|
|
- sql.Append("insert into prodiobarcode (PIB_ID,PIB_PRODCODE,pib_inman,PIB_INDATE,PIB_INOUTNO,PIB_PIID,pib_brand,PIB_BARCODE,PIB_PDNO,");
|
|
|
- sql.Append("PIB_PDID,PIB_PICLASS,PIB_QTY,pib_datecode,pib_lotno,PIB_OUTBOXCODE1,PIB_IFPRINT,PIB_IFPICK,PIB_ORDERCODE,pib_orderdetno,pib_outboxcode2,pib_custbarcode)");
|
|
|
- sql.Append(" values (prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,'" + pi_inoutno.Text + "'");
|
|
|
- sql.Append("," + PI_ID + ",:pr_brand,:barcode,:pd_pdno,:pd_id,");
|
|
|
- sql.Append("'" + pi_class.Text + "',:pib_inqty,:pib_datecode,:pib_lotno,0,0,:pd_ordercode,'',:pd_orderdetno,:outboxcode,:custbarcode)");
|
|
|
- dh.BatchInsert(sql.ToString(), new string[] { "pd_prodcode", "pr_brand", "barcode", "pd_pdno", "pd_id", "pib_inqty", "pib_datecode", "pib_lotno", "pd_ordercode", "pd_orderdetno", "outboxcode", "custbarcode" }, pdprodcode.ToArray(), prbrand.ToArray(), barcode.ToArray(), pdpdno.ToArray(), pdid.ToArray(), pib_inqty.ToArray(), datecode.ToArray(), lotno.ToArray(), pdordercode.ToArray(), pdorderdetno.ToArray(), piboutboxcode2.ToArray(), custbarcode.ToArray());
|
|
|
- //更新流水
|
|
|
- dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
|
|
|
- LoadGridData();
|
|
|
+ if (pdprodcode.Count > 0)
|
|
|
+ {
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("insert into prodiobarcode (PIB_ID,PIB_PRODCODE,pib_inman,PIB_INDATE,PIB_INOUTNO,PIB_PIID,pib_brand,PIB_BARCODE,PIB_PDNO,");
|
|
|
+ sql.Append("PIB_PDID,PIB_PICLASS,PIB_QTY,pib_datecode,pib_lotno,PIB_OUTBOXCODE1,PIB_IFPRINT,PIB_IFPICK,PIB_ORDERCODE,pib_orderdetno,pib_outboxcode2,pib_custbarcode)");
|
|
|
+ sql.Append(" values (prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,'" + pi_inoutno.Text + "'");
|
|
|
+ sql.Append("," + PI_ID + ",:pr_brand,:barcode,:pd_pdno,:pd_id,");
|
|
|
+ sql.Append("'" + pi_class.Text + "',:pib_inqty,:pib_datecode,:pib_lotno,0,0,:pd_ordercode,'',:pd_orderdetno,:outboxcode,:custbarcode)");
|
|
|
+ dh.BatchInsert(sql.ToString(), new string[] { "pd_prodcode", "pr_brand", "barcode", "pd_pdno", "pd_id", "pib_inqty", "pib_datecode", "pib_lotno", "pd_ordercode", "pd_orderdetno", "outboxcode", "custbarcode" }, pdprodcode.ToArray(), prbrand.ToArray(), barcode.ToArray(), pdpdno.ToArray(), pdid.ToArray(), pib_inqty.ToArray(), datecode.ToArray(), lotno.ToArray(), pdordercode.ToArray(), pdorderdetno.ToArray(), piboutboxcode2.ToArray(), custbarcode.ToArray());
|
|
|
+ //更新流水
|
|
|
+ dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
|
|
|
+ LoadGridData();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox.Show("解析数据不包含出货单数据,请重新导入", "提示");
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -2528,8 +2577,95 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
+ LogManager.DoLog(ex.StackTrace);
|
|
|
MessageBox.Show(ex.Message);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ int rowindex = 0;
|
|
|
+
|
|
|
+ private void LabelInf_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
|
|
|
+ {
|
|
|
+ if (e.Button == MouseButtons.Right)
|
|
|
+ {
|
|
|
+ rowindex = e.RowIndex;
|
|
|
+ DateCodeSetAndPrint date = new DateCodeSetAndPrint();
|
|
|
+ date.Controls["SetValue"].Click += SetValue_ButtonClick;
|
|
|
+ date.Controls["SetValueAndPrint"].Click += SetValueAndPrint_ButtonClick;
|
|
|
+ date.ShowDialog();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void SetValue_ButtonClick(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ Button setvalue = sender as Button;
|
|
|
+ string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
|
|
|
+ string datecode = setvalue.FindForm().Controls["datecode"].Text;
|
|
|
+ string lotno = setvalue.FindForm().Controls["lotno"].Text;
|
|
|
+ string nums = setvalue.FindForm().Controls["Nums"].Text;
|
|
|
+ string year = "0";
|
|
|
+ string month = "0";
|
|
|
+ string day = "0";
|
|
|
+ string sql = "update prodiobarcode set pib_autoset=-1,pib_ifrecheck=-1,pib_ifpick=-1,pib_ifmodify=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno;
|
|
|
+ if (datecode != "")
|
|
|
+ {
|
|
|
+ sql += " and (pib_datecode='' or pib_datecode is null) ";
|
|
|
+ }
|
|
|
+ if (lotno != "")
|
|
|
+ {
|
|
|
+ sql += " and (pib_lotno='' or pib_lotno is null) ";
|
|
|
+ }
|
|
|
+ if (nums == "")
|
|
|
+ {
|
|
|
+ sql += ")";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sql += " limit 0," + nums + ")";
|
|
|
+ }
|
|
|
+ sdh.ExecuteSql(sql, "update");
|
|
|
+ LoadGridData();
|
|
|
+ setvalue.FindForm().Close();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void SetValueAndPrint_ButtonClick(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ Button setvalueandprint = sender as Button;
|
|
|
+ string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
|
|
|
+ string datecode = setvalueandprint.FindForm().Controls["datecode"].Text;
|
|
|
+ string lotno = setvalueandprint.FindForm().Controls["lotno"].Text;
|
|
|
+ string nums = setvalueandprint.FindForm().Controls["Nums"].Text;
|
|
|
+ string year = "0";
|
|
|
+ string month = "0";
|
|
|
+ string day = "0";
|
|
|
+ string sql = "update prodiobarcode set pib_autoset=-1,pib_ifrecheck=-1,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_id in (select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno;
|
|
|
+ string PrintSQL = "select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno;
|
|
|
+ if (datecode != "")
|
|
|
+ {
|
|
|
+ sql += " and (pib_datecode='' or pib_datecode is null) ";
|
|
|
+ PrintSQL += " and (pib_datecode='' or pib_datecode is null) ";
|
|
|
+ }
|
|
|
+ if (lotno != "")
|
|
|
+ {
|
|
|
+ sql += " and (pib_lotno='' or pib_lotno is null) ";
|
|
|
+ PrintSQL += " and (pib_lotno='' or pib_lotno is null) ";
|
|
|
+ }
|
|
|
+ if (nums == "")
|
|
|
+ {
|
|
|
+ sql += ")";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sql += " limit 0," + nums + ")";
|
|
|
+ PrintSQL += " limit 0," + nums;
|
|
|
+ }
|
|
|
+ DataTable pibid_dt = (DataTable)sdh.ExecuteSql(PrintSQL, "select");
|
|
|
+ sdh.ExecuteSql(sql, "update");
|
|
|
+ for (int i = 0; i < pibid_dt.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ Print.BarTender.SinglePrint(SingleFormat, SingleLabelParam, pibid_dt.Rows[i]["pib_id"].ToString());
|
|
|
+ }
|
|
|
+ setvalueandprint.FindForm().Close();
|
|
|
+ }
|
|
|
}
|
|
|
}
|