Exemplo n.º 1
0
        public GetAllObjectivesDataResponse GetAllObjectives(GetAllObjectivesDataRequest request)
        {
            GetAllObjectivesDataResponse response = new GetAllObjectivesDataResponse();
            ILookUpRepository            repo     = Factory.GetRepository(request, RepositoryType.LookUp);
            List <ObjectiveData>         data     = repo.GetAllObjectives();

            if (data != null)
            {
                response.ObjectivesData = data;
            }
            return(response);
        }
Exemplo n.º 2
0
        public void GetAllObjectives_Test()
        {
            // Arrange
            double version        = 1.0;
            string contractNumber = "InHealth001";
            string context        = "NG";
            GetAllObjectivesDataRequest request = new GetAllObjectivesDataRequest {
                Context = context, ContractNumber = contractNumber, Version = version
            };

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

            // Assert
            Assert.AreNotEqual(0, response.ObjectivesData.Count);
        }
Exemplo n.º 3
0
        public GetAllObjectivesDataResponse Get(GetAllObjectivesDataRequest request)
        {
            GetAllObjectivesDataResponse response = new GetAllObjectivesDataResponse();

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

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