Example #1
0
 private int getPercent(HistoryJobModel j)
 {
     if ((j.TotalPieces == null || j.TotalPieces == 0) && j.Code.ToUpper().StartsWith("M#2"))
     {
         return(100);
     }
     return(Common.GetPercentage(j.PiecesProduced ?? 0, j.TotalPieces ?? 0).RoundToInt() > 100
         ? 100
         : Common.GetPercentage(j.PiecesProduced ?? 0, j.TotalPieces ?? 0).RoundToInt());
 }
Example #2
0
 private long?getResTime(CurrentStateModel currentState, HistoryJobModel job)
 {
     if (currentState == null)
     {
         return(null);
     }
     if (job.Day == null || currentState.LastUpdated == null)
     {
         return(null);
     }
     if (job.Code == currentState.JobCode &&
         job.TotalPieces == currentState.JobTotalPieces &&
         job.Day.Value.Date == currentState.LastUpdated.Value.Date)
     {
         return(currentState.ResidueWorkingTimeJob);
     }
     return(null);
 }