|
|
@@ -354,7 +354,7 @@ namespace UAS_LabelMachine
|
|
|
sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
|
|
|
dh.BatchInsert(sql.ToString(), new string[] { "PIB_ID", "PIB_CUSTBARCODE" }, PIBID, CustBarCode.ToArray());
|
|
|
//更新流水号
|
|
|
- dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + CodeCount) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
|
|
|
+ dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
|
|
|
LoadGridData(new object(), new EventArgs());
|
|
|
//加载完数据之后进行容量的判断
|
|
|
int BoxNum = LabelInfDataTable.Select("pib_outboxcode2='" + OutBoxNum.Text + "'").Length;
|
|
|
@@ -905,9 +905,9 @@ namespace UAS_LabelMachine
|
|
|
//名称相等的时候,取SQL进行值的查询
|
|
|
string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
|
|
|
string pib_outboxcode1 = LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString();
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiobarcode where pib_id=" + pib_id, "select");
|
|
|
- MidReport.RegisterData(dt, "Prodiobarcode");
|
|
|
- MidReport.GetDataSource("Prodiobarcode").Enabled = true;
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 主键ID=" + pib_id + "' and 中盒号='" + pib_outboxcode1 + "'", "select");
|
|
|
+ MidReport.RegisterData(dt, "prodiomidinfo_view");
|
|
|
+ MidReport.GetDataSource("prodiomidinfo_view").Enabled = true;
|
|
|
MidReport.PrintSettings.Printer = MidLabelPrinter.Text;
|
|
|
MidReport.Print();
|
|
|
Properties.Settings.Default.MPrinter = MidLabelPrinter.Text;
|
|
|
@@ -1506,6 +1506,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
//生成中盒条码
|
|
|
int pib_outboxcode1 = 0;
|
|
|
+ CurrentMaxNum = CurrentMaxNum - 1;
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
List<string> MidBoxCode = new List<string>();
|
|
|
@@ -1515,7 +1516,7 @@ namespace UAS_LabelMachine
|
|
|
//如果不是10的整数倍则为尾盒
|
|
|
for (int j = 0; j < dt1.Rows.Count; j++)
|
|
|
{
|
|
|
- if (j % 10 == 0 && j != 0)
|
|
|
+ if (j % 10 == 0)
|
|
|
{
|
|
|
pib_outboxcode1 = pib_outboxcode1 + 1;
|
|
|
CurrentMaxNum = CurrentMaxNum + 1;
|
|
|
@@ -1537,14 +1538,14 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
List<string> OutBoxCode = new List<string>();
|
|
|
List<string> PIBOUTBOXCODE2 = new List<string>();
|
|
|
- string serialcode = BaseUtil.DToAny(MaxNum, Radix);
|
|
|
+ string serialcode = BaseUtil.DToAny(CurrentMaxNum, Radix);
|
|
|
for (int k = serialcode.ToString().Length; k < NumLength; k++)
|
|
|
{
|
|
|
serialcode = "0" + serialcode;
|
|
|
}
|
|
|
OutBoxCode.Add(Prefix + serialcode + Suffix);
|
|
|
PIBOUTBOXCODE2.Add(dt.Rows[i]["pib_outboxcode2"].ToString());
|
|
|
- MaxNum = MaxNum + 1;
|
|
|
+ CurrentMaxNum = CurrentMaxNum + 1;
|
|
|
dh.BatchInsert("update prodiobarcode set pib_custoutboxcode=:pib_custoutboxcode where pib_outboxcode2=:pib_outboxcode2 and pib_custoutboxcode is null", new string[] { "pib_custoutboxcode", "pib_outboxcode2" }, OutBoxCode.ToArray(), PIBOUTBOXCODE2.ToArray());
|
|
|
}
|
|
|
dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + CurrentMaxNum + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
|