Added Hold Report to the production reports.

This commit is contained in:
Daniel Wathen
2023-01-16 12:28:48 -07:00
parent bbd396c25e
commit 9525355b55
8 changed files with 124 additions and 6 deletions

View File

@ -523,4 +523,48 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
return date;
}
public List<HoldLot> GetCurrentHoldLots()
{
List<HoldLot> lots = new();
OpenConnection();
SqlCommand cmd = _connection.CreateCommand();
string query = "SELECT WO_NO, " +
" HOLD_START_DTM, " +
" HOLD_START_USER, " +
" HOLD_START_REASON, " +
" SEQ, " +
" REACTOR " +
" FROM WO_MAT_HOLD_HISTORY, RDS " +
" WHERE HOLD_STOP_DTM = '1/1/1900' " +
" AND HOLD_START_DTM > '1/1/2022' " +
" AND HOLD_ENTITY_ID = SEQ " +
"ORDER BY HOLD_START_DTM ASC";
cmd.CommandText = query;
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
lots.Add(new HoldLot
{
WO_NO = reader[0].ToString(),
HOLD_DATE = DateTime.Parse(reader[1].ToString()),
HOLD_USER = reader[2].ToString(),
HOLD_REASON = reader[3].ToString(),
RDS_NO = reader[4].ToString(),
REACTOR = reader[5].ToString(),
});
}
cmd.Dispose();
CloseConnection();
return lots;
}
}