Beispiel #1
0
        /// <summary>
        /// 配置値设定
        /// </summary>
        private Boolean SetDatabaseConfig()
        {
            NdnXmlConfig xmlConfig;

            xmlConfig = new NdnXmlConfig(NCConst.CONFIG_FILE_DIR + NCUtility.GetAppConfig());
            string strConnectionString = string.Format(
                "Data Source={0};Initial Catalog={1};User ID={2};Password={3}",
                txtDataSource.Text, txtDatabase.Text, txtUser.Text, NCCryp.Encrypto(txtPwd.Text));
            string str = "ConnectionString";

            if (!xmlConfig.WriteValue("database", str, strConnectionString))
            {
                string msg = string.Format(NCMessage.GetInstance(db.Language).GetMessageById("CM0450E", db.Language), str);
                NCLogger.GetInstance().WriteErrorLog(msg);
                return(false);
            }
            strConnectionString = string.Format(
                "Data Source={0};Initial Catalog={1};User ID={2};Password={3}",
                txtDataSource.Text, "master", txtUser.Text, NCCryp.Encrypto(txtPwd.Text));
            str = "MConnectionString";
            if (!xmlConfig.WriteValue("database", str, strConnectionString))
            {
                string msg = string.Format(NCMessage.GetInstance(db.Language).GetMessageById("CM0450E", db.Language), str);
                NCLogger.GetInstance().WriteErrorLog(msg);
                return(false);
            }
            return(SetDatabaseConfig2());
        }
Beispiel #2
0
        /// <summary>
        /// 配置値设定
        /// </summary>
        private void SetSkinValue(string Skin)
        {
            NdnXmlConfig xmlConfig;
            string       path = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "Config");

            xmlConfig = new NdnXmlConfig(Path.Combine(path, "HPSTest.Config"));
            if (!xmlConfig.WriteValue("config", "Skin", Skin))
            {
            }
        }
Beispiel #3
0
        /// <summary>
        /// 配置値设定
        /// </summary>
        private bool SetConfigValue()
        {
            bool         ret = true;
            NdnXmlConfig xmlConfig;
            string       path = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "Config");

            xmlConfig = new NdnXmlConfig(Path.Combine(path, "HPSTest.Config"));
            if (!xmlConfig.WriteValue("config", "company", company))
            {
                ret = false;
            }
            if (!xmlConfig.WriteValue("config", "home", home))
            {
                ret = false;
            }
            if (!xmlConfig.WriteValue("config", "home2", home2))
            {
                ret = false;
            }
            return(ret);
        }
Beispiel #4
0
        /// <summary>
        /// 配置値设定
        /// </summary>
        private bool SetConfigValue()
        {
            bool ret = true;

            NC.HPS.Lib.NdnXmlConfig xmlConfig;
            string appName = Path.GetFileNameWithoutExtension(System.Windows.Forms.Application.ExecutablePath);

            xmlConfig = new NdnXmlConfig(string.Format(NCConst.CONFIG_FILE_DIR, appName) + NCUtility.GetAppConfig());
            if (!xmlConfig.WriteValue("config", "ServerUrl", ServerUrl))
            {
                ret = false;
            }
            if (!xmlConfig.WriteValue("config", "UserName", UserName))
            {
                ret = false;
            }
            if (!xmlConfig.WriteValue("config", "Password", Password))
            {
                ret = false;
            }
            return(ret);
        }
Beispiel #5
0
        /// <summary>
        /// 配置値设定
        /// </summary>
        private void SetProductValue(string product)
        {
            string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0460I", db.Language);

            NCLogger.GetInstance().WriteInfoLog(msg);
            NdnXmlConfig xmlConfig;

            xmlConfig = new NdnXmlConfig(NCConst.CONFIG_FILE_DIR + NCUtility.GetAppConfig());
            if (!xmlConfig.WriteValue("config", "Product", product))
            {
                msg = string.Format(NCMessage.GetInstance(db.Language).GetMessageById("CM0450E", db.Language), product);
                NCLogger.GetInstance().WriteErrorLog(msg);
            }
            msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0470I", db.Language);
            NCLogger.GetInstance().WriteInfoLog(msg);
        }