Пример #1
0
 protected override void DataPortal_Update()
 {
     using (var ctx = DalFactory.GetManager(DalManagerTypes.AppConfigManager)) {
         var dal = ctx.GetProvider <IAppConfigDal>();
         using (BypassPropertyChecks) {
             var item = new AppConfigDto {
                 BaseUri        = BaseUri,
                 ClientSecret   = ClientSecret,
                 DalManagerType = DalManagerType,
                 DbInUse        = DbInUse
             };
             dal.Update(item);
         }
     }
 }
Пример #2
0
        public void Update(AppConfigDto data)
        {
            // Open App.Config of executable
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            // Add Application Settings.
            config.AppSettings.Settings.Remove("DalManagerTypeAuthCode");
            config.AppSettings.Settings.Add("DalManagerTypeAuthCode", data.DalManagerType);
            config.AppSettings.Settings.Remove("WSBaseUri");
            config.AppSettings.Settings.Add("WSBaseUri", data.BaseUri);
            config.AppSettings.Settings.Remove("ClientSecret");
            config.AppSettings.Settings.Add("ClientSecret", data.ClientSecret);
            config.AppSettings.Settings.Remove("DbInUse");
            config.AppSettings.Settings.Add("DbInUse", data.DbInUse);
            // Save the configuration file.
            config.Save(ConfigurationSaveMode.Modified);
            // Force a reload of a changed section.
            ConfigurationManager.RefreshSection("appSettings");
        }
Пример #3
0
 public void Insert(AppConfigDto data)
 {
     throw new NotImplementedException();
 }