/// <summary> /// Create a deep copy of this object. /// </summary> /// <returns>A <see cref="TrainLocationTimeModel"/> instance that is a deep copy of this instance.</returns> public new TrainLocationTimeModel Copy() { return(new TrainLocationTimeModel { ActualTime = ActualTime?.Copy(), DisplayedText = DisplayedText, DisplayedTextFootnote = DisplayedTextFootnote, DisplayedTextHours = DisplayedTextHours, DisplayedTextMinutes = DisplayedTextMinutes, EntryType = EntryType, LocationKey = LocationKey, LocationId = LocationId, IsPassingTime = IsPassingTime, }); }
public async Task AddActualTimeAsync(ActualTimeDTO actualTime) { var user = Authorization.GetUser(); var userRole = user.GetType(); if (userRole != typeof(Administrator)) { throw new MethodAccessException(); } var entity = new ActualTime() { TimeEnter = actualTime.TimeEnter, TimeExit = actualTime.TimeExit, WorkDayId = actualTime.WorkDayId }; await _unitOfWork.ActualTimeRepository.AddAsync(entity); await _unitOfWork.Complete(); }
private IActualTimeService GetActualTimeService(int itemId, DateTime timeEnter, DateTime timeExit) { var mockContext = new Mock <IUnitOfWork>(); var expectedActualTime = new ActualTime() { Id = itemId, TimeEnter = timeEnter, TimeExit = timeExit }; var repMock = new Mock <IActualTimeRepository>(); repMock.Setup(mock => mock.GetAsync(itemId)).ReturnsAsync(expectedActualTime); mockContext .Setup(context => context.ActualTimeRepository) .Returns(repMock.Object); mockContext.Setup(mock => mock.ActualTimeRepository.GetAsync(itemId)).ReturnsAsync(expectedActualTime); IActualTimeService actualTimeService = new ActualTimeService(mockContext.Object); return(actualTimeService); }
public double percentPerformance() { double percent = ActualTime.CompareTo(StandardTime); return(percent); }
public bool IsActualTimeNotDetermined() { return(ActualTime.Equals(ACTUAL_TIME_NULL_VALUE)); }