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()); }
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"); }
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); }