diff --git a/InjectionPC/FrmMain2408.cs b/InjectionPC/FrmMain2408.cs index 6f7b40a..c991c74 100644 --- a/InjectionPC/FrmMain2408.cs +++ b/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 = ""; diff --git a/MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs b/MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs index bdd51d3..10d0fe9 100644 --- a/MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs +++ b/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);