/// <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,
     });
 }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public double percentPerformance()
        {
            double percent = ActualTime.CompareTo(StandardTime);

            return(percent);
        }
Exemplo n.º 5
0
 public bool IsActualTimeNotDetermined()
 {
     return(ActualTime.Equals(ACTUAL_TIME_NULL_VALUE));
 }