public GetCategoryDataResponse CategoryList()
        {
            GetCategoryDataResponse result = new GetCategoryDataResponse();

            result.Data = _sub.getCategoryList();
            return(result);
        }
Beispiel #2
0
        public GetCategoryDataResponse GetCategoryByID(GetCategoryDataRequest request)
        {
            GetCategoryDataResponse result = new GetCategoryDataResponse();
            ILookUpRepository       repo   = Factory.GetRepository(request, RepositoryType.LookUp);

            result.Category = repo.FindCategoryByID(request.CategoryID) as IdNamePair;

            return(result != null ? result : new GetCategoryDataResponse());
        }
Beispiel #3
0
        public void GetCategoryByID_Test()
        {
            // Arrange
            double version                 = 1.0;
            string contractNumber          = "InHealth001";
            string context                 = "NG";
            GetCategoryDataRequest request = new GetCategoryDataRequest {
                CategoryID = "52a0bc5fd4332322b4aed5b7", Context = context, ContractNumber = contractNumber, Version = version
            };

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

            // Assert
            Assert.IsTrue(response.Category.Name == "Process");
        }
Beispiel #4
0
        public GetCategoryDataResponse Get(GetCategoryDataRequest request)
        {
            GetCategoryDataResponse response = new GetCategoryDataResponse();

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

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