예제 #1
0
        ///// <summary>
        ///// ავტომატურად ამატებს ახალ ჩანაწერს.
        ///// </summary>
        //public static bool AutoNewRow { get; set; }

        //private static string _SkinName = "Caramel";
        ///// <summary>
        ///// სკინის დასახელება.
        ///// </summary>
        //public static string SkinName
        //{
        //    get { return _SkinName; }
        //    set
        //    {
        //        if (value == null) value = "Caramel";
        //        _SkinName = value;
        //    }
        //}

        ///// <summary>
        ///// ფორმებზე სკინის ჩართვა.
        ///// </summary>
        //public static bool AllowFormSkins { get; set; }
        #endregion

        /// <summary>
        /// კონფიგურაციის ჩატვირთვა.
        /// </summary>
        public static void BaseLoad()
        {
            OnlineServerName   = GetString("OnlineServerName");
            OnlineDatabaseName = GetString("OnlineDatabaseName");
            OnlineUserName     = GetString("OnlineUserName");
            if (GetString("OnlinePassword").Length > 0)
            {
                OnlinePassword = SymCryptoHelper.TripleDESDecrypt(GetString("OnlinePassword"), Salt, Key, IV);
            }
            OnlineConnectionTimeout = GetInt32("OnlineConnectionTimeout");
            OnlineCommandTimeout    = GetInt32("OnlineCommandTimeout");

            IsOffline = GetBool("IsOffline");
            IsOnline  = !IsOffline;

            OfflineServerName   = GetString("OfflineServerName");
            OfflineDatabaseName = GetString("OfflineDatabaseName");
            OfflineUserName     = GetString("OfflineUserName");
            if (GetString("OfflinePassword").Length > 0)
            {
                OfflinePassword = SymCryptoHelper.TripleDESDecrypt(GetString("OfflinePassword"), Salt, Key, IV);
            }
            OfflineConnectionTimeout = GetInt32("OfflineConnectionTimeout");
            OfflineCommandTimeout    = GetInt32("OfflineCommandTimeout");

            LoginUserName = GetString("LoginUserName");
            LoginPassword = GetString("LoginPassword");

            //AutoNewRow = GetBool("AutoNewRow");
            //SkinName = GetString("SkinName");
            //AllowFormSkins = GetBool("AllowFormSkins");

            BaseBuilderConnectionStrings();
        }
예제 #2
0
        public static void Load()
        {
            CreatorID                    = ConfigurationManager.AppSettings["CreatorID"].ToInt32();
            CoordinatorID                = ConfigurationManager.AppSettings["CoordinatorID"].ToInt32();
            BranchID                     = ConfigurationManager.AppSettings["BranchID"].ToInt32();
            DeclaratorID                 = ConfigurationManager.AppSettings["DeclaratorID"].ToInt32();
            PaymentReceiverID            = ConfigurationManager.AppSettings["PaymentReceiverID"].ToInt32();
            PaymentReceiverBankAccountID = ConfigurationManager.AppSettings["PaymentReceiverBankAccountID"].ToInt32();
            ProviderID                   = ConfigurationManager.AppSettings["ProviderID"].ToInt32();

            var providers = string.Empty;

            foreach (var c in ConfigurationManager.AppSettings["AppointmentServiceProviders"])
            {
                if (char.IsNumber(c) || c == ';' || c == ',' || c == '|' || c == '/' || c == '-' || c == '_')
                {
                    providers += c;
                }
            }
            AppointmentServiceProviders = Array.ConvertAll(providers.Split(new[] { ';', ',', '|', '/', '-', '_' }, StringSplitOptions.RemoveEmptyEntries), int.Parse);

            OurDiscountReal = ConfigurationManager.AppSettings["OurDiscountReal"].ToDecimal();


            INS_Server   = ConfigurationManager.AppSettings["INS_Server"];
            INS_Database = ConfigurationManager.AppSettings["INS_Database"];
            INS_User     = ConfigurationManager.AppSettings["INS_User"];

            var pass = ConfigurationManager.AppSettings["INS_Password"];

            if (pass.IsNotNullAndWhiteSpace())
            {
                INS_Password = SymCryptoHelper.TripleDESDecrypt(pass, Salt, Key, IV);
            }


            CRM_Server   = ConfigurationManager.AppSettings["CRM_Server"];
            CRM_Database = ConfigurationManager.AppSettings["CRM_Database"];
            CRM_User     = ConfigurationManager.AppSettings["CRM_User"];

            pass = ConfigurationManager.AppSettings["CRM_Password"];
            if (pass.IsNotNullAndWhiteSpace())
            {
                CRM_Password = SymCryptoHelper.TripleDESDecrypt(pass, Salt, Key, IV);
            }

            TakeCount = ConfigurationManager.AppSettings["TakeCount"].ToInt32();
            BuilderConnectionStrings();
        }
예제 #3
0
        /// <summary>
        /// კონფიგურაციის ჩატვირთვა.
        /// </summary>
        protected static void BaseLoad()
        {
            Server   = GetNullableString("Server");
            Database = GetNullableString("Database");
            UserName = GetNullableString("UserName");
            if (!string.IsNullOrWhiteSpace(GetNullableString("Password")))
            {
                Password = SymCryptoHelper.TripleDESDecrypt(GetNullableString("Password"), Salt, Key, IV);
            }
            ConnectionTimeout = GetNullableInt32("ConnectionTimeout");
            CommandTimeout    = GetNullableInt32("CommandTimeout");

            LoginUserName = GetNullableString("LoginUserName");
            LoginPassword = GetNullableString("LoginPassword");

            BaseBuilderConnectionStrings();
        }
예제 #4
0
        public static void Load()
        {
            ServerName        = GetStringValue("ServerName");
            DatabaseName      = GetStringValue("DatabaseName");
            UserName          = GetStringValue("UserName");
            ConnectionTimeout = GetIntValue("ConnectionTimeout");
            CommandTimeout    = GetIntValue("CommandTimeout");

            var initCryptoFlag = false;

            if (GetStringValue("Password").Length > 0)
            {
                if (GetStringValue("Password") == "nOEilOowHR8=")
                {
                    initCryptoFlag = true;
                    Password       = "******";
                }
                else
                {
                    Password = SymCryptoHelper.TripleDESDecrypt(GetStringValue("Password"), Salt, Key, IV);
                }
            }

            LoginUserName = GetStringValue("LoginUserName");
            LoginPassword = GetStringValue("LoginPassword");

            AutoNewRow  = GetBoolValue("AutoNewRow");
            OfflineMode = GetBoolValue("OfflineMode");

            OfflineServerName        = GetStringValue("OfflineServerName");
            OfflineDatabaseName      = GetStringValue("OfflineDatabaseName");
            OfflineUserName          = GetStringValue("OfflineUserName");
            OfflineConnectionTimeout = GetIntValue("OfflineConnectionTimeout");
            OfflineCommandTimeout    = GetIntValue("OfflineCommandTimeout");
            if (GetStringValue("OfflinePassword").Length > 0)
            {
                if (GetStringValue("OfflinePassword") == "nOEilOowHR8=")
                {
                    initCryptoFlag  = true;
                    OfflinePassword = "******";
                }
                else
                {
                    OfflinePassword = SymCryptoHelper.TripleDESDecrypt(GetStringValue("OfflinePassword"), Salt, Key, IV);
                }
            }


            SkinName       = GetStringValue("SkinName");
            AllowFormSkins = GetBoolValue("AllowFormSkins");


            UseHedgehog  = GetBoolValue("UseHedgehog");
            HedgehogFile = GetStringValue("HedgehogFile");

            if (initCryptoFlag)
            {
                Save();
            }

            BuilderConnectionStrings();
        }