Example #1
0
        public GetAllTimesOfDaysDataResponse GetAllTimesOfDays(GetAllTimesOfDaysDataRequest request)
        {
            GetAllTimesOfDaysDataResponse response = new GetAllTimesOfDaysDataResponse();
            ILookUpRepository             repo     = Factory.GetRepository(request, RepositoryType.LookUp);
            List <IdNamePair>             data     = repo.GetAllTimesOfDays();

            if (data != null)
            {
                response.TimesOfDays = data;
            }
            return(response);
        }
Example #2
0
        public void GetAllTimesOfDays_Test()
        {
            // Arrange
            double version        = 1.0;
            string contractNumber = "InHealth001";
            string context        = "NG";
            GetAllTimesOfDaysDataRequest request = new GetAllTimesOfDaysDataRequest {
                Context = context, ContractNumber = contractNumber, Version = version
            };

            // Act
            LookUpDataManager lm = new LookUpDataManager {
                Factory = new LookUpRepositoryFactory()
            };
            GetAllTimesOfDaysDataResponse response = lm.GetAllTimesOfDays(request);

            // Assert
            Assert.AreNotEqual(0, response.TimesOfDays.Count);
        }
Example #3
0
        public GetAllTimesOfDaysDataResponse Get(GetAllTimesOfDaysDataRequest request)
        {
            GetAllTimesOfDaysDataResponse response = new GetAllTimesOfDaysDataResponse();

            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("LookUpDD:Get()::Unauthorized Access");
                }

                response         = LookUpDataManager.GetAllTimesOfDays(request);
                response.Version = request.Version;
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);

                string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Common.Helper.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }