예제 #1
0
        public virtual void CanGetActiveSystemsSortedByCodeAsc()
        {
            IList <WrmsSystem> result = _wrmsSystemRepository.GetActiveSystems(-1, "Code", "Asc");

            Assert.That(result.Count > 0);
            Assert.That(result[0].Code.CompareTo(result[1].Code) <= 0);
            Assert.That(result[0].Code.CompareTo(result[result.Count - 1].Code) <= 0);
            foreach (var val in result)
            {
                if (val.Id == 307)
                {
                    Assert.That(false);
                }
            }
        }
        public TimeEntryFormViewModel CreateFormViewModel(DateTime weekEndingDate, string userName)
        {
            var user      = _personManagementService.GetByUserName(userName);
            var viewModel = new TimeEntryFormViewModel
            {
                WeekEndingDate = weekEndingDate,
                RecentRequests = _timeEntryRepository.GetRecentRequests(user.Id),
                Systems        = _wrmsSystemRepository.GetActiveSystems(0, "Code", "Asc"),
                UserId         = user.Id
            };

            return(viewModel);
        }
예제 #3
0
 public IList <WrmsSystem> GetActiveSystems(int systemIdToInclude)
 {
     return(_wrmsSystemRepository.GetActiveSystems(systemIdToInclude, "Code", "Asc"));
 }