예제 #1
0
        public static GetTextStepDataResponse GetTextStepByID(GetTextStepDataRequest request)
        {
            GetTextStepDataResponse result = new GetTextStepDataResponse();

            IStepRepository <GetTextStepDataResponse> repo = StepRepositoryFactory <GetTextStepDataResponse> .GetStepRepository(request.ContractNumber, request.Context, textstep);

            repo.UserId = request.UserId;
            result      = repo.FindByID(request.TextStepID) as GetTextStepDataResponse;

            return(result != null ? result : new GetTextStepDataResponse());
        }
예제 #2
0
        public void GetTextStepByID_Test()
        {
            // Arrange
            double version                 = 1.0;
            string contractNumber          = "InHealth001";
            string context                 = "NG";
            GetTextStepDataRequest request = new GetTextStepDataRequest {
                TextStepID = "52a64270d433231824878c93", Context = context, ContractNumber = contractNumber, Version = version
            };

            // Act
            GetTextStepDataResponse response = StepDataManager.GetTextStepByID(request);

            // Assert
            Assert.IsTrue(response.TextStep.Description == "P4H Enrollment detail script and eligibility details");
        }
예제 #3
0
        public GetTextStepDataResponse Get(GetTextStepDataRequest request)
        {
            GetTextStepDataResponse response = new GetTextStepDataResponse();

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

                response         = StepDataManager.GetTextStepByID(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);
        }