Browse Source

打码检验箱码数量,改为查询数据库

master
ruoxing.wang 2 weeks ago
parent
commit
53c2a4713c
  1. 31
      InjectionPC/FrmMain2408.cs
  2. 2
      MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs

31
InjectionPC/FrmMain2408.cs

@ -3539,19 +3539,42 @@ namespace InjectionPC
Label lbPackageCode = lbPackageCodeL;
Label lbNeedQty = lbNeedQtyL;
Label lbCurrentlQty = lbCurrentlQtyL;
DataTable packageTable = new DataTable();
if (mould == _leftType)
{
lbPackageCode = lbPackageCodeL;
lbNeedQty = lbNeedQtyL;
lbCurrentlQty = lbCurrentlQtyL;
packageTable = _injectionBoxBLL.SearchUnBox(Program.station, "0");
}
else
{
lbPackageCode = lbPackageCodeR;
lbNeedQty = lbNeedQtyR;
lbCurrentlQty = lbCurrentlQtyR;
packageTable = _injectionBoxBLL.SearchUnBox(Program.station, "1");
}
string pkgCode = string.Empty;
string boxCount1 = string.Empty;
if (packageTable.Rows.Count > 0)
{
pkgCode = packageTable.Rows[0]["BoxNo"].ToString();
boxCount1 = packageTable.Rows[0]["BoxCount"].ToString();
lbPackageCode.Text = pkgCode;
lbCurrentlQty.Text = boxCount1;
}
else
{
pkgCode = "";
lbPackageCode.Text = pkgCode;
boxCount1 = "0";
lbCurrentlQty.Text = boxCount1;
}
string pkgCode = lbPackageCode.Text.Trim();
//string pkgCode = lbPackageCode.Text.Trim();
@ -3618,10 +3641,10 @@ namespace InjectionPC
//判断当前箱码是否已经打印,或者实际完成数量已经达到满器具
else
{
DataTable boxTable = _injectionBoxBLL.SearchBox(pkgCode);
if (boxTable.Rows.Count > 0)
//DataTable boxTable = _injectionBoxBLL.SearchBox(pkgCode);
if (packageTable.Rows.Count > 0)
{
DataRow boxRow = boxTable.Rows[0];
DataRow boxRow = packageTable.Rows[0];
if(boxRow["IsPrint"].ToString() == "1")
{
lbPackageCode.Text = "";

2
MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs

@ -274,7 +274,7 @@ namespace MESClassLibrary.DAL.Injection
{
try
{
string sql = @"select * from " + TableName + " where StationNo=@StationNo and Mould=@Mould and IsPrint=0 order by CreateTime desc ";
string sql = @"select * from " + TableName + " where StationNo=@StationNo and Mould=@Mould and IsPrint=0 and CreateTime>= DATEADD(DAY, -14, GETDATE()) order by CreateTime desc ";
SqlParameter[] param = new SqlParameter[2];
param[0] = new SqlParameter("@StationNo", SqlDbType.VarChar);

Loading…
Cancel
Save