Example #1
0
        /// <summary>
        /// 选择数据库模板
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btSelectDbTempLate_Click(object sender, EventArgs e)
        {
            frmDBSet dBSet = new frmDBSet(string.Format("选取数据库模板"), string.Format("数据库存储结构,用于初始化正式库、临时库和历史库"));

            if (dBSet.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            DBConfig dbTemplateConfig = dBSet.DbConfig;
            string   strConfigName    = dbTemplateConfig.GetConfigName();

            if (m_dicTemplateDb.ContainsKey(strConfigName))
            {
                DevExpress.XtraEditors.XtraMessageBox.Show(string.Format("当前模板列表已存在"), "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else
            {
                m_dicTemplateDb.Add(strConfigName, dbTemplateConfig);
                CheckedListBoxItem item = new CheckedListBoxItem();
                item.Value      = strConfigName;
                item.CheckState = CheckState.Unchecked;
                listDbTemplate.Items.Add(item);
            }
        }
Example #2
0
        /// <summary>
        ///设置正式库连接
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btSetOffcalDbConnect_Click(object sender, EventArgs e)
        {
            frmDBSet dBSet = new frmDBSet(string.Format("设置正式数据库连接"), string.Format("正式数据主要是指成果数据存储位置"));

            if (dBSet.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            DBConfig OffcalDbConfig = dBSet.DbConfig;

            txtOfficalDbSet.Text = OffcalDbConfig.GetConfigName();
            //将连接信息存储到业务库中
            string strMessage = m_sysConfig.UpdateSysConfig(ColumnName.OfficDbConfigCode, OffcalDbConfig.GetConfigStr(), string.Format("临时库配置"));

            if (!string.IsNullOrEmpty(strMessage))
            {
                DevExpress.XtraEditors.XtraMessageBox.Show(strMessage, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }