예제 #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public static string GetApplicationPath()
 {
     using (ISettingRepository setttingRepository = new SettingsRepository())
     {
         return setttingRepository.GetApplicationPath();
     }
 }
예제 #2
0
        /// <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;
            }
        }
예제 #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public static Setting GetSetting()
 {
     using (ISettingRepository setttingRepository = new SettingsRepository())
     {
         return setttingRepository.GetSeting();
     }
 }
예제 #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public static void SaveSetting(Setting setting)
 {
     using (ISettingRepository setttingRepository = new SettingsRepository())
     {
         setttingRepository.SaveSetting(setting);
     }
 }
예제 #5
0
        /// <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;
            }
        }
예제 #6
0
 /// <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);
     }
 }
예제 #7
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static List<FileInfo> GetTemplateFileList()
        {
            using (ISettingRepository setttingRepository = new SettingsRepository())
            {
                string templateFilePath = setttingRepository.GetSeting().ReportingParameter.TemplatePath;

                return setttingRepository.GetTemplateFileList(templateFilePath);
            }
        }