SLLTools.json file and DailyReportInfo.json file automatically clear the first time it runs on Monday, and fixed bug when scrap is resolved as null.
This commit is contained in:
@ -86,15 +86,21 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
|
||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read() && reader[0].ToString() != "1/1/1900 12:00:00 AM")
|
||||
{
|
||||
int twProd = string.IsNullOrEmpty(reader[3].ToString()) ? 0 : int.Parse(reader[3].ToString());
|
||||
int custScrap = string.IsNullOrEmpty(reader[1].ToString()) ? 0 : int.Parse(reader[1].ToString());
|
||||
int manuScrap = string.IsNullOrEmpty(reader[2].ToString()) ? 0 : int.Parse(reader[2].ToString());
|
||||
int totScrap = custScrap + manuScrap;
|
||||
|
||||
scrap.Add(new ScrapByDay
|
||||
{
|
||||
StartDate = reader[0].ToString(),
|
||||
TW_PROD = int.Parse(reader[3].ToString()),
|
||||
TOT_REJ_CUST = int.Parse(reader[1].ToString()),
|
||||
TOT_REJ_MANU = int.Parse(reader[2].ToString()),
|
||||
TOT_REJ_WFRS =
|
||||
int.Parse(reader[1].ToString()) + int.Parse(reader[2].ToString())
|
||||
TW_PROD = twProd,
|
||||
TOT_REJ_CUST = custScrap,
|
||||
TOT_REJ_MANU = manuScrap,
|
||||
TOT_REJ_WFRS = totScrap
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
|
Reference in New Issue
Block a user