public static IList <GetServerInformationResult> TranslateResultSet(IDataReader reader) { IList <GetServerInformationResult> resultList = new List <GetServerInformationResult>(); object data; while (reader.Read()) { GetServerInformationResult result = new GetServerInformationResult(); data = reader["SERVER_HOST"]; if (data != DBNull.Value) { result.ServerHost = DbTypeConvertor.Convert <string>(data); } data = reader["LOGG_PATH"]; if (data != DBNull.Value) { result.DirectoryPath = DbTypeConvertor.Convert <string>(data); } resultList.Add(result); } return(resultList); }
public GetServerInformationResponse GetServerInformation() { GetServerInformationAction action = PolicyInjection.Create <GetServerInformationAction>(); GetServerInformationResult businessResult = action.Execute(); GetServerInformationResponse response = new GetServerInformationResponse(); if (businessResult != null) { response.GetServerInformationResult = Translators.GetServerInformationTranslator.TranslateFromBusinessToService(businessResult); } return(response); }
public GetServerInformationResult Execute() { ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings[schemaName]; string connectionString = settings.ConnectionString; ITracingDao tracingDao = PolicyInjection.Create <TracingDao, ITracingDao>(connectionString); IList <GetServerInformationResult> resultList = null; resultList = tracingDao.GetServerInformation(new GetServerInformationParameters()); GetServerInformationResult result = new GetServerInformationResult(); if (resultList != null && resultList.Count > 0) { result.ServerHost = resultList[0].ServerHost; result.DirectoryPath = resultList[0].DirectoryPath; } return(result); }