Exemple #1
0
        public GetAllSettingsDataResponse GetAllSettings(GetAllSettingsDataRequest request)
        {
            GetAllSettingsDataResponse response = new GetAllSettingsDataResponse();
            ILookUpRepository          repo     = Factory.GetRepository(request, RepositoryType.Setting);
            List <MESetting>           list     = repo.SelectAll() as List <MESetting>;

            if (list != null && list.Count > 0)
            {
                Dictionary <string, string> data = new Dictionary <string, string>();
                list.ForEach(s =>
                {
                    data.Add(s.Key, s.Value);
                });

                response.SettingsData = data;
            }
            return(response);
        }
Exemple #2
0
        public void GetAllSettings_Test()
        {
            // Arrange
            double version                    = 1.0;
            string contractNumber             = "InHealth001";
            string context                    = "NG";
            GetAllSettingsDataRequest request = new GetAllSettingsDataRequest {
                Context = context, ContractNumber = contractNumber, Version = version
            };

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

            // Assert
            Assert.IsTrue(response.SettingsData.Count > 0);
        }
Exemple #3
0
        public GetAllSettingsDataResponse Get(GetAllSettingsDataRequest request)
        {
            GetAllSettingsDataResponse response = new GetAllSettingsDataResponse();

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

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