public void AddInLineStartTime(DataRow row, string count) { checkingForPause = new CheckingForPause(_pauseTimesRepository); DateTime newStartTime = new DateTime(); DateTime endTime = new DateTime(); double setupTime = 0; double time = 0; foreach (DataRow row1 in _dataForInLineTable.GetFromItemsOperations(row["OperationId"].ToString()).Rows) { setupTime = double.Parse((row["SetupTime"]).ToString()); time = double.Parse((row["Time"]).ToString()); newStartTime = Convert.ToDateTime(row1["EndTime"]); endTime = timeOfEnd.getEndTimeWithPause(_pauseTimesRepository, newStartTime, time, count, setupTime); if (timeOfEnd.isStartTimeInPause) { TimeSpan timeSpan = checkingForPause.PauseTimes(getStartTimeInPause, newStartTime, timeOfEnd.getEndTimeWithPause(_pauseTimesRepository, _timeRepository, row["ItemId"].ToString(), row["OperationId"].ToString(), count)); newStartTime = newStartTime.Add(timeSpan); timeOfEnd.isStartTimeInPause = false; } } _startTimeRepository.AddInLineStartTime(1, newStartTime, endTime, count, row["ItemId"].ToString(), row["OperationId"].ToString()); }
public byte[] GetProcentagePictureForViewForm2(IPauseTimesRepository pauseTimesRepository, DataRow row, double completedTime) { CheckingForPause = new CheckingForPause(pauseTimesRepository); byte[] picture = Picture.Create(0, 0); TimeSpan timeSp = Convert.ToDateTime(row["EndTime"]).Subtract(Convert.ToDateTime(row["StartTime"])); double processDuration = timeSp.TotalSeconds; DateTime timeNow = DateTime.Now; double pauseTime = double.Parse(CheckingForPause.PauseTimes(getStartTimeInPause, Convert.ToDateTime(row["StartTime"].ToString()), Convert.ToDateTime(row["EndTime"].ToString())).Minutes.ToString()); //pause.testPauseIftrueAddTime(getStartTimeInPause, Convert.ToDateTime(item["StartaLaiks"].ToString()), Convert.ToDateTime(item["BeiguLaiks"].ToString())).Minutes.ToString()); if (processDuration > completedTime) { int procentage = Convert.ToInt32((completedTime / processDuration) * 100); picture = Picture.CreateWithProcentage(procentage); if (procentage == 100) { picture = Picture.Create(0, 0); } } return(picture); }
public void AddInLineStartTimeIfEntryExist(string item, string operation, string count) { checkingForPause = new CheckingForPause(_pauseTimesRepository); inLineOperationsId = new InLineOperationsId(); DateTime newStartTime = new DateTime(); DateTime endTime = new DateTime(); double setupTime = 0; double time = 0; foreach (DataRow row in _dataForInLineTable.GetFromInLine(item, operation).Rows) { setupTime = double.Parse((row["SetupTime"]).ToString()); time = double.Parse((row["Time"]).ToString()); newStartTime = Convert.ToDateTime(row["EndTime"]); endTime = timeOfEnd.getEndTimeWithPause(_pauseTimesRepository, newStartTime, time, count, setupTime); if (timeOfEnd.isStartTimeInPause) { TimeSpan timeSpan = checkingForPause.PauseTimes(getStartTimeInPause, newStartTime, timeOfEnd.getEndTimeWithPause(_pauseTimesRepository, newStartTime, time, count, setupTime)); newStartTime = newStartTime.Add(timeSpan); timeOfEnd.isStartTimeInPause = false; } } _startTimeRepository.AddInLineStartTime(inLineOperationsId.Get(_dataForInLineTable, int.Parse(operation.ToString())), newStartTime, endTime, count, item, operation); }
public DateTime getEndTimeWithPause(IPauseTimesRepository pauseTimesRepository, ITimeRepository timeRepository, string comboBoxItems, string comboBoxOperations, string textBoxCount) { checkingForPause = new CheckingForPause(pauseTimesRepository); DateTime time = DateTime.Now; DateTime endTimeWithoutPauses = getEndTime(time, timeRepository.GetTime(comboBoxItems, comboBoxOperations), Int32.Parse(textBoxCount), timeRepository.GetSetupTime(comboBoxItems, comboBoxOperations)); DateTime endTime = endTimeWithoutPauses.Add(checkingForPause.PauseTimes(getStartTimeInPause, time, endTimeWithoutPauses)); return(endTime); }
public DateTime getEndTimeWithPause(IPauseTimesRepository pauseTimesRepository, DateTime newStartTime, double necessaryTime, string textBoxRunItemsCount, double sagatavoĊĦanasLasiks) { checkingForPause = new CheckingForPause(pauseTimesRepository); DateTime endTimeWithoutPauses = getEndTime(newStartTime, necessaryTime, int.Parse(textBoxRunItemsCount), sagatavoĊĦanasLasiks); DateTime endTime = endTimeWithoutPauses.Add(checkingForPause.PauseTimes(getStartTimeInPause, newStartTime, endTimeWithoutPauses)); return(endTime); }
public void AddStartTime(DataRow row, string textBoxCount) { checkingForPause = new CheckingForPause(_pauseTimesRepository); DateTime time = DateTime.Now; DateTime endTime = timeOfEnd.getEndTimeWithPause(_pauseTimesRepository, _timeRepository, row, textBoxCount); if (timeOfEnd.isStartTimeInPause) { TimeSpan timeSpan = checkingForPause.PauseTimes(getStartTimeInPause, time, timeOfEnd.getEndTimeWithPause(_pauseTimesRepository, _timeRepository, row, textBoxCount)); time = time.Add(timeSpan); timeOfEnd.isStartTimeInPause = false; } _startTimeRepository.AddStartTime(time, endTime, row, textBoxCount); }
public void AddStartTime(string comboBoxItems, string comboBoxOperations, string textBoxCount) { checkingForPause = new CheckingForPause(_pauseTimesRepository); DateTime time = DateTime.Now; DateTime endTime = timeOfEnd.getEndTimeWithPause(_pauseTimesRepository, _timeRepository, comboBoxItems, comboBoxOperations, textBoxCount); if (timeOfEnd.isStartTimeInPause) { TimeSpan timeSpan = checkingForPause.PauseTimes(getStartTimeInPause, time, timeOfEnd.getEndTimeWithPause(_pauseTimesRepository, _timeRepository, comboBoxItems, comboBoxOperations, textBoxCount)); time = time.Add(timeSpan); timeOfEnd.isStartTimeInPause = false; } _startTimeRepository.AddStartTime(time, endTime, textBoxCount, comboBoxItems, comboBoxOperations); }