ruoxing.wang 2 months ago
parent
commit
147949f4b3
  1. 2
      InjectionPC/FrmMain2408.cs
  2. 7
      MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs

2
InjectionPC/FrmMain2408.cs

@ -4156,7 +4156,7 @@ namespace InjectionPC
MessageBox.Show("没找到上一个箱码"); MessageBox.Show("没找到上一个箱码");
return; return;
} }
PrintBoxCode(dr, int.Parse(dr["StandardQty"].ToString()), "0"); PrintBoxCode(dr, int.Parse(dr["BoxCount"].ToString()), "0");
} }

7
MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs

@ -696,7 +696,12 @@ namespace MESClassLibrary.DAL.BasicInfo
{ {
try try
{ {
string sql = @"select top 1 * from " + tableName + " where BarCode=@BarCode and IsBad=0 and IsDel=0 order by [CreateTime] desc "; string columnName = "OneBarCode";
if (BarCode.Contains("."))
{
columnName = "BarCode";
}
string sql = @"select top 1 * from " + tableName + $" where {columnName}=@BarCode and IsBad=0 and IsDel=0 order by [CreateTime] desc ";
SqlParameter[] param = new SqlParameter[1]; SqlParameter[] param = new SqlParameter[1];
param[0] = new SqlParameter("@BarCode", SqlDbType.VarChar); param[0] = new SqlParameter("@BarCode", SqlDbType.VarChar);

Loading…
Cancel
Save