Beispiel #1
0
        public GetObjectiveDataResponse GetObjectiveByID(GetObjectiveDataRequest request)
        {
            GetObjectiveDataResponse result = new GetObjectiveDataResponse();
            ILookUpRepository        repo   = Factory.GetRepository(request, RepositoryType.LookUp);

            result.Objective = repo.FindObjectiveByID(request.ObjectiveID) as IdNamePair;

            return(result != null ? result : new GetObjectiveDataResponse());
        }
Beispiel #2
0
        public void GetObjectiveByID_Test()
        {
            // Arrange
            double version                  = 1.0;
            string contractNumber           = "InHealth001";
            string context                  = "NG";
            GetObjectiveDataRequest request = new GetObjectiveDataRequest {
                ObjectiveID = "52a0beb9d43323141c9eb26c", Context = context, ContractNumber = contractNumber, Version = version
            };

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

            // Assert
            Assert.IsTrue(response.Objective.Name == "Reduce Risk Factors");
        }
Beispiel #3
0
        public GetObjectiveDataResponse Get(GetObjectiveDataRequest request)
        {
            GetObjectiveDataResponse response = new GetObjectiveDataResponse();

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

                response         = LookUpDataManager.GetObjectiveByID(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);
        }