/// <summary> /// /// </summary> /// <returns></returns> public static string GetApplicationPath() { using (ISettingRepository setttingRepository = new SettingsRepository()) { return setttingRepository.GetApplicationPath(); } }
/// <summary> /// /// </summary> /// <returns></returns> public static Setting AddConnection(WSConnection connection, bool isActive, out StatesEnum state) { using (ISettingRepository settingRepository = new SettingsRepository()) { var setting = settingRepository.GetSeting(); if (!CommonBLL.CheckService(connection)) { state = StatesEnum.ServiceInvalid; return setting; } if (!setting.WSConnections.Any(x => x.Equals(connection))) { setting.WSConnections.Add(connection); } else { state = StatesEnum.ConnectionAlreadyExist; } if (isActive) { setting.ChangeActiveConnection(connection.Uri.ToString()); state = StatesEnum.ConnectionAddedAndActivated; } else { state = StatesEnum.ConnectionAddedSuccessfully; } settingRepository.SaveSetting(setting); return setting; } }
/// <summary> /// /// </summary> /// <returns></returns> public static Setting GetSetting() { using (ISettingRepository setttingRepository = new SettingsRepository()) { return setttingRepository.GetSeting(); } }
/// <summary> /// /// </summary> /// <returns></returns> public static void SaveSetting(Setting setting) { using (ISettingRepository setttingRepository = new SettingsRepository()) { setttingRepository.SaveSetting(setting); } }
/// <summary> /// /// </summary> /// <returns></returns> public static Setting RemoveConnection(WSConnection connection) { using (ISettingRepository setttingRepository = new SettingsRepository()) { var setting = setttingRepository.GetSeting(); setting.WSConnections.Remove(connection); setttingRepository.SaveSetting(setting); return setting; } }
/// <summary> /// /// </summary> /// <returns></returns> public static List<FileInfo> GetTemplateFileListPortfolio() { using (ISettingRepository setttingRepository = new SettingsRepository()) { ReportingParameter rp = new ReportingParameter(); string templateFilePath = setttingRepository.GetSeting().ReportingParameter.TemplatePath; //return setttingRepository.GetTemplateFileList(templateFilePath + "\\Portfolio"); return setttingRepository.GetTemplateFileList(templateFilePath + rp.PortfolioFolderNamePath); } }
/// <summary> /// /// </summary> /// <returns></returns> public static List<FileInfo> GetTemplateFileList() { using (ISettingRepository setttingRepository = new SettingsRepository()) { string templateFilePath = setttingRepository.GetSeting().ReportingParameter.TemplatePath; return setttingRepository.GetTemplateFileList(templateFilePath); } }