Ejemplo n.º 1
0
        public static void GetConfig()
        {
            bool flag;

            SystemInfo.CustomerCompanyName = ConfigurationManager.AppSettings["CustomerCompanyName"];
            SystemInfo.ConfigurationFrom   = BaseConfiguration.GetConfiguration(ConfigurationManager.AppSettings["ConfigurationFrom"]);
            SystemInfo.SoftName            = ConfigurationManager.AppSettings["SoftName"];
            SystemInfo.SoftFullName        = ConfigurationManager.AppSettings["SoftFullName"];
            SystemInfo.RootMenuCode        = ConfigurationManager.AppSettings["RootMenuCode"];
            SystemInfo.ServiceUserName     = ConfigurationManager.AppSettings["ServiceUserName"];
            SystemInfo.ServicePassword     = ConfigurationManager.AppSettings["ServicePassword"];
            if (ConfigurationManager.AppSettings["EnableEncryptServerPassword"] != null)
            {
                flag = true;
                SystemInfo.EnableEncryptServerPassword = ConfigurationManager.AppSettings["EnableEncryptServerPassword"].ToUpper().Equals(flag.ToString().ToUpper());
            }
            if (ConfigurationManager.AppSettings["EncryptClientPassword"] != null)
            {
                flag = true;
                SystemInfo.EncryptClientPassword = ConfigurationManager.AppSettings["EncryptClientPassword"].ToUpper().Equals(flag.ToString().ToUpper());
            }
            if (ConfigurationManager.AppSettings["EnableCheckIPAddress"] != null)
            {
                flag = true;
                SystemInfo.EnableCheckIPAddress = ConfigurationManager.AppSettings["EnableCheckIPAddress"].ToUpper().Equals(flag.ToString().ToUpper());
            }
            if (ConfigurationManager.AppSettings["CheckOnLine"] != null)
            {
                flag = true;
                SystemInfo.CheckOnLine = ConfigurationManager.AppSettings["CheckOnLine"].ToUpper().Equals(flag.ToString().ToUpper());
            }
            if (ConfigurationManager.AppSettings["RDIFrameworkDbType"] != null)
            {
                SystemInfo.RDIFrameworkDbType = BaseConfiguration.GetDbType(ConfigurationManager.AppSettings["RDIFrameworkDbType"]);
            }
            if (ConfigurationManager.AppSettings["BusinessDbType"] != null)
            {
                SystemInfo.BusinessDbType = BaseConfiguration.GetDbType(ConfigurationManager.AppSettings["BusinessDbType"]);
            }
            if (ConfigurationManager.AppSettings["WorkFlowDbType"] != null)
            {
                SystemInfo.WorkFlowDbType = BaseConfiguration.GetDbType(ConfigurationManager.AppSettings["WorkFlowDbType"]);
            }
            if (ConfigurationManager.AppSettings["EncryptDbConnection"] != null)
            {
                flag = true;
                SystemInfo.EncryptDbConnection = ConfigurationManager.AppSettings["EncryptDbConnection"].ToUpper().Equals(flag.ToString().ToUpper());
            }
            SystemInfo.BusinessDbConnectionString    = ConfigurationManager.AppSettings["BusinessDbConnection"];
            SystemInfo.RDIFrameworkDbConectionString = ConfigurationManager.AppSettings["RDIFrameworkDbConection"];
            SystemInfo.WorkFlowDbConnectionString    = ConfigurationManager.AppSettings["WorkFlowDbConnection"];
            if (SystemInfo.EncryptDbConnection)
            {
                SystemInfo.BusinessDbConnection    = SecretHelper.smethod_1(SystemInfo.BusinessDbConnectionString);
                SystemInfo.RDIFrameworkDbConection = SecretHelper.smethod_1(SystemInfo.RDIFrameworkDbConectionString);
                SystemInfo.WorkFlowDbConnection    = SecretHelper.smethod_1(SystemInfo.WorkFlowDbConnectionString);
            }
            else
            {
                SystemInfo.BusinessDbConnection    = ConfigurationManager.AppSettings["BusinessDbConnection"];
                SystemInfo.RDIFrameworkDbConection = ConfigurationManager.AppSettings["RDIFrameworkDbConection"];
                SystemInfo.WorkFlowDbConnection    = ConfigurationManager.AppSettings["WorkFlowDbConnection"];
            }
            SystemInfo.RegisterKey = ConfigurationManager.AppSettings["RegisterKey"];
        }
Ejemplo n.º 2
0
        public static void GetConfig(string fileName)
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(fileName);
            if (Exists("CurrentUserName"))
            {
                SystemInfo.CurrentUserName = GetValue(xmlDocument, "CurrentUserName");
            }
            if (Exists("CurrentPassword"))
            {
                SystemInfo.CurrentPassword = GetValue(xmlDocument, "CurrentPassword");
            }
            if (Exists("MultiLanguage"))
            {
                SystemInfo.MultiLanguage = string.Compare(GetValue(xmlDocument, "MultiLanguage"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("CurrentLanguage"))
            {
                SystemInfo.CurrentLanguage = GetValue(xmlDocument, "CurrentLanguage");
            }
            if (Exists("RememberPassword"))
            {
                SystemInfo.RememberPassword = string.Compare(GetValue(xmlDocument, "RememberPassword"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("AutoLogOn"))
            {
                SystemInfo.AutoLogOn = string.Compare(GetValue(xmlDocument, "AutoLogOn"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EnableCheckPasswordStrength"))
            {
                SystemInfo.EnableCheckPasswordStrength = string.Compare(GetValue(xmlDocument, "EnableCheckPasswordStrength"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EncryptClientPassword"))
            {
                SystemInfo.EncryptClientPassword = string.Compare(GetValue(xmlDocument, "EncryptClientPassword"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EnableEncryptServerPassword"))
            {
                SystemInfo.EnableEncryptServerPassword = string.Compare(GetValue(xmlDocument, "EnableEncryptServerPassword"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("CurrentStyle"))
            {
                SystemInfo.CurrentStyle = GetValue(xmlDocument, "CurrentStyle");
            }
            if (Exists("CurrentThemeColor"))
            {
                SystemInfo.CurrentThemeColor = GetValue(xmlDocument, "CurrentThemeColor");
            }
            if (Exists("OnLineTime0ut"))
            {
                string str = GetValue(xmlDocument, "OnLineTime0ut");
                if (!(string.IsNullOrEmpty(str) || !MathHelper.IsInteger(str)))
                {
                    SystemInfo.OnLineTime0ut = Convert.ToInt16(str);
                }
            }
            if (Exists("EnableCheckIPAddress"))
            {
                SystemInfo.EnableCheckIPAddress = string.Compare(GetValue(xmlDocument, "EnableCheckIPAddress"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("CheckOnLine"))
            {
                SystemInfo.CheckOnLine = string.Compare(GetValue(xmlDocument, "CheckOnLine"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("UseMessage"))
            {
                SystemInfo.UseMessage = string.Compare(GetValue(xmlDocument, "UseMessage"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("AllowUserToRegister"))
            {
                SystemInfo.AllowUserToRegister = string.Compare(GetValue(xmlDocument, "AllowUserToRegister"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EnableRecordLog"))
            {
                SystemInfo.EnableRecordLog = string.Compare(GetValue(xmlDocument, "EnableRecordLog"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            SystemInfo.CustomerCompanyName = GetValue(xmlDocument, "CustomerCompanyName");
            SystemInfo.ConfigurationFrom   = BaseConfiguration.GetConfiguration(GetValue(xmlDocument, "ConfigurationFrom"));
            SystemInfo.SoftName            = GetValue(xmlDocument, "SoftName");
            SystemInfo.SoftFullName        = GetValue(xmlDocument, "SoftFullName");
            SystemInfo.RootMenuCode        = GetValue(xmlDocument, "RootMenuCode");
            SystemInfo.Version             = GetValue(xmlDocument, "Version");
            if (Exists("EnableUserAuthorization"))
            {
                SystemInfo.EnableUserAuthorization = string.Compare(GetValue(xmlDocument, "EnableUserAuthorization"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EnableModulePermission"))
            {
                SystemInfo.EnableModulePermission = string.Compare(GetValue(xmlDocument, "EnableModulePermission"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EnablePermissionItem"))
            {
                SystemInfo.EnablePermissionItem = string.Compare(GetValue(xmlDocument, "EnablePermissionItem"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EnableTableFieldPermission"))
            {
                SystemInfo.EnableTableFieldPermission = string.Compare(GetValue(xmlDocument, "EnableTableFieldPermission"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EnableTableConstraintPermission"))
            {
                SystemInfo.EnableTableConstraintPermission = string.Compare(GetValue(xmlDocument, "EnableTableConstraintPermission"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EnableUserAuthorizationScope"))
            {
                SystemInfo.EnableUserAuthorizationScope = string.Compare(GetValue(xmlDocument, "EnableUserAuthorizationScope"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("EnableHandWrittenSignature"))
            {
                SystemInfo.EnableHandWrittenSignature = string.Compare(GetValue(xmlDocument, "EnableHandWrittenSignature"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            if (Exists("DefaultPassword"))
            {
                SystemInfo.DefaultPassword = GetValue(xmlDocument, "DefaultPassword");
                SystemInfo.DefaultPassword = SecretHelper.smethod_1(SystemInfo.DefaultPassword);
            }
            if (Exists("LoadAllUser"))
            {
                SystemInfo.LoadAllUser = string.Compare(GetValue(xmlDocument, "LoadAllUser"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            }
            SystemInfo.Service = GetValue(xmlDocument, "Service");
            if (Exists("LogOnAssembly"))
            {
                SystemInfo.LogOnAssembly = GetValue(xmlDocument, "LogOnAssembly");
            }
            if (Exists("LogOnForm"))
            {
                SystemInfo.LogOnForm = GetValue(xmlDocument, "LogOnForm");
            }
            if (Exists("MainForm"))
            {
                SystemInfo.MainForm = GetValue(xmlDocument, "MainForm");
            }
            int.TryParse(GetValue(xmlDocument, "OnLineLimit"), out SystemInfo.OnLineLimit);
            if (Exists("RDIFrameworkDbType"))
            {
                SystemInfo.RDIFrameworkDbType = BaseConfiguration.GetDbType(GetValue(xmlDocument, "RDIFrameworkDbType"));
            }
            if (Exists("BusinessDbType"))
            {
                SystemInfo.BusinessDbType = BaseConfiguration.GetDbType(GetValue(xmlDocument, "BusinessDbType"));
            }
            if (Exists("WorkFlowDbType"))
            {
                SystemInfo.WorkFlowDbType = BaseConfiguration.GetDbType(GetValue(xmlDocument, "WorkFlowDbType"));
            }
            SystemInfo.EncryptDbConnection           = string.Compare(GetValue(xmlDocument, "EncryptDbConnection"), "TRUE", true, CultureInfo.CurrentCulture) == 0;
            SystemInfo.BusinessDbConnectionString    = GetValue(xmlDocument, "BusinessDbConnection");
            SystemInfo.WorkFlowDbConnectionString    = GetValue(xmlDocument, "WorkFlowDbConnection");
            SystemInfo.RDIFrameworkDbConectionString = GetValue(xmlDocument, "RDIFrameworkDbConection");
            if (SystemInfo.EncryptDbConnection)
            {
                SystemInfo.WorkFlowDbConnection    = SecretHelper.smethod_1(SystemInfo.WorkFlowDbConnectionString);
                SystemInfo.BusinessDbConnection    = SecretHelper.smethod_1(SystemInfo.BusinessDbConnectionString);
                SystemInfo.RDIFrameworkDbConection = SecretHelper.smethod_1(SystemInfo.RDIFrameworkDbConectionString);
            }
            else
            {
                SystemInfo.WorkFlowDbConnection    = SystemInfo.WorkFlowDbConnectionString;
                SystemInfo.BusinessDbConnection    = SystemInfo.BusinessDbConnectionString;
                SystemInfo.RDIFrameworkDbConection = SystemInfo.RDIFrameworkDbConectionString;
            }
            SystemInfo.ServiceUserName         = GetValue(xmlDocument, "ServiceUserName");
            SystemInfo.ServicePassword         = GetValue(xmlDocument, "ServicePassword");
            SystemInfo.ServicePassword         = SecretHelper.smethod_1(SystemInfo.ServicePassword);
            SystemInfo.RegisterKey             = GetValue(xmlDocument, "RegisterKey");
            SystemInfo.ErrorReportFrom         = GetValue(xmlDocument, "ErrorReportFrom");
            SystemInfo.ErrorReportMailUserName = GetValue(xmlDocument, "ErrorReportMailUserName");
            SystemInfo.ErrorReportMailPassword = GetValue(xmlDocument, "ErrorReportMailPassword");
            SystemInfo.ErrorReportMailServer   = GetValue(xmlDocument, "ErrorReportMailServer");
            SystemInfo.ErrorReportMailPassword = SecretHelper.smethod_1(SystemInfo.ErrorReportMailPassword);
            string str2 = GetValue(xmlDocument, "RDIFrameworkBlog");

            if (!string.IsNullOrEmpty(str2))
            {
                SystemInfo.RDIFrameworkBlog = str2;
            }
            string str3 = GetValue(xmlDocument, "RDIFrameworkWeibo");

            if (!string.IsNullOrEmpty(str3))
            {
                SystemInfo.RDIFrameworkWeibo = str3;
            }
        }