コード例 #1
0
        /// <summary>
        /// კონფიგურაციის დამახსოვრება.
        /// </summary>
        public static void BaseSave()
        {
            var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            Set(config, "OnlineServerName", OnlineServerName);
            Set(config, "OnlineDatabaseName", OnlineDatabaseName);
            Set(config, "OnlineUserName", OnlineUserName);
            Set(config, "OnlineConnectionTimeout", OnlineConnectionTimeout);
            Set(config, "OnlineCommandTimeout", OnlineCommandTimeout);
            Set(config, "OnlinePassword", OnlinePassword.Length > 0 ? SymCryptoHelper.TripleDESEncrypt(OnlinePassword, Salt, Key, IV) : string.Empty);

            Set(config, "IsOffline", IsOffline);
            if (IsOffline)
            {
                Set(config, "OfflineServerName", OfflineServerName);
                Set(config, "OfflineDatabaseName", OfflineDatabaseName);
                Set(config, "OfflineUserName", OfflineUserName);
                Set(config, "OfflineConnectionTimeout", OfflineConnectionTimeout);
                Set(config, "OfflineCommandTimeout", OfflineCommandTimeout);
                Set(config, "OfflinePassword", OfflinePassword.Length > 0 ? SymCryptoHelper.TripleDESEncrypt(OfflinePassword, Salt, Key, IV) : string.Empty);
            }


            Set(config, "LoginUserName", LoginUserName);
            Set(config, "LoginPassword", LoginPassword);

            //Set(config, "AutoNewRow", AutoNewRow);
            //Set(config, "SkinName", SkinName);
            //Set(config, "AllowFormSkins", AllowFormSkins);

            config.Save();
            BaseBuilderConnectionStrings();
        }
コード例 #2
0
ファイル: BaseAppConfig.cs プロジェクト: giorgizek/ZekV1
        /// <summary>
        /// კონფიგურაციის დამახსოვრება.
        /// </summary>
        protected static void BaseSave()
        {
            var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            Set(config, "Server", Server);
            Set(config, "Database", Database);
            Set(config, "UserName", UserName);
            Set(config, "Password", !string.IsNullOrWhiteSpace(Password) ? SymCryptoHelper.TripleDESEncrypt(Password, Salt, Key, IV) : null);
            Set(config, "ConnectionTimeout", ConnectionTimeout);
            Set(config, "CommandTimeout", CommandTimeout);

            Set(config, "LoginUserName", LoginUserName);
            Set(config, "LoginPassword", LoginPassword);

            config.Save();
            BaseBuilderConnectionStrings();
        }
コード例 #3
0
        public static void Save()
        {
            var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            SetValue(config, "ServerName", ServerName);
            SetValue(config, "DatabaseName", DatabaseName);
            SetValue(config, "UserName", UserName);
            SetValue(config, "ConnectionTimeout", ConnectionTimeout.ToString(CultureInfo.InvariantCulture));
            SetValue(config, "CommandTimeout", CommandTimeout.ToString(CultureInfo.InvariantCulture));
            var value = (Password.Length > 0) ? SymCryptoHelper.TripleDESEncrypt(Password, Salt, Key, IV) : string.Empty;

            SetValue(config, "Password", value);

            SetValue(config, "LoginUserName", LoginUserName);
            SetValue(config, "LoginPassword", LoginPassword);

            SetValue(config, "AutoNewRow", AutoNewRow);
            SetValue(config, "OfflineMode", OfflineMode);

            SetValue(config, "OfflineServerName", OfflineServerName);
            SetValue(config, "OfflineDatabaseName", OfflineDatabaseName);
            SetValue(config, "OfflineUserName", OfflineUserName);
            SetValue(config, "OfflineConnectionTimeout", OfflineConnectionTimeout.ToString(CultureInfo.InvariantCulture));
            SetValue(config, "OfflineCommandTimeout", OfflineCommandTimeout.ToString(CultureInfo.InvariantCulture));
            value = (OfflinePassword.Length > 0) ? SymCryptoHelper.TripleDESEncrypt(OfflinePassword, Salt, Key, IV) : string.Empty;
            SetValue(config, "OfflinePassword", value);


            SetValue(config, "SynchronizationProvider", GetStringValue("SynchronizationProvider"));
            SetValue(config, "WSSynchronizationUrl", GetStringValue("WSSynchronizationUrl"));
            SetValue(config, "WSUserName", GetStringValue("WSUserName"));
            SetValue(config, "WSPassword", GetStringValue("WSPassword"));
            SetValue(config, "WSDomain", GetStringValue("WSDomain"));


            SetValue(config, "SkinName", SkinName);
            SetValue(config, "AllowFormSkins", AllowFormSkins);

            SetValue(config, "UseHedgehog", UseHedgehog);
            SetValue(config, "HedgehogFile", HedgehogFile);


            config.Save();
            BuilderConnectionStrings();
        }
コード例 #4
0
        public static void Save()
        {
            try
            {
                var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

                Set(config, "CreatorID", CreatorID.ToNullableString());
                Set(config, "CoordinatorID", CoordinatorID.ToNullableString());
                Set(config, "BranchID", CoordinatorID.ToNullableString());
                Set(config, "DeclaratorID", DeclaratorID.ToNullableString());
                Set(config, "PaymentReceiverID", PaymentReceiverID.ToNullableString());
                Set(config, "PaymentReceiverBankAccountID", PaymentReceiverBankAccountID.ToNullableString());
                Set(config, "ProviderID", ProviderID.ToNullableString());
                Set(config, "AppointmentServiceProviders", string.Join(";", AppointmentServiceProviders));
                Set(config, "OurDiscountReal", OurDiscountReal.ToNullableString());


                Set(config, "INS_Server", INS_Server.IfNullEmpty());
                Set(config, "INS_Database", INS_Database.IfNullEmpty());
                Set(config, "INS_User", INS_User.IfNullEmpty());
                Set(config, "INS_Password", SymCryptoHelper.TripleDESEncrypt(INS_Password.IfNullEmpty(), Salt, Key, IV));

                Set(config, "CRM_Server", CRM_Server.IfNullEmpty());
                Set(config, "CRM_Database", CRM_Database.IfNullEmpty());
                Set(config, "CRM_User", CRM_User.IfNullEmpty());
                Set(config, "CRM_Password", SymCryptoHelper.TripleDESEncrypt(CRM_Password.IfNullEmpty(), Salt, Key, IV));

                Set(config, "TakeCount", TakeCount.ToNullableString());

                config.Save();
            }
            catch (Exception ex)
            {
                throw new Exception("Error while saving configuration (see inner exception).", ex);
            }
        }