Пример #1
0
        private void CmdProcess_Exited(object sender, EventArgs e)
        {
            string myConnString = "user id=" + UpdateInfo.DBusername + ";data source=" + UpdateInfo.DBSID + ";password="******"insert into system_version_info(modulename,modulecode,version,publish_date,update_date,remark) " +
                                  "values('" + name + "','" + code + "','" + ver + "','" + publishdate + "',to_char(sysdate, 'yyyy-mm-dd hh24:mi:ss'),'" + keyword + "')";

            try {
                if (UpdateInfo.DBType.Equals("sqlserver"))
                {
                    sql = "insert into system_version_info(modulename,modulecode,version,publish_date,update_date,remark) " +
                          "values('" + name + "','" + code + "','" + ver + "','" + publishdate + "', convert(varchar(20),getdate(),121),'" + keyword + "')";
                    myConnString = "Initial Catalog=" + UpdateInfo.DBSID + ";Data Source=" + UpdateInfo.DBDataSource + ";User ID=" + UpdateInfo.DBusername + "; Password="******"插点版本信息你数据库里去,又不会怀孕。干嘛呢?" + e1.Message, "提示");
            }

            MessageBox.Show("SQL语句执行完毕!", "提示");
        }
        public bool OnNextButton()
        {
            if (string.IsNullOrEmpty(this.textBox2.Text))
            {
                MessageBox.Show("请选择备份目录", "提示");
                return(false);
            }
            if (string.IsNullOrEmpty(this.textBox1.Text) || string.IsNullOrEmpty(this.textBox4.Text))
            {
                MessageBox.Show("Sorry,你必须得连接数据库,否则,最后执行SQL就悲催了。");
                return(false);
            }
            else
            {
                XmlHelper.Delete("/root/DBConfig", "");
                XmlHelper.Insert("/root", "DBConfig", "", "");
                XmlHelper.Insert("/root/DBConfig", "username", "", this.textBox1.Text);
                XmlHelper.Insert("/root/DBConfig", "password", "", this.textBox3.Text);
                XmlHelper.Insert("/root/DBConfig", "SID", "", this.textBox4.Text);
                string myConnString = "";
                if (this.radioButton1.Checked)
                {
                    XmlHelper.Insert("root/DBConfig", "TYPE", "", "oracle");
                    myConnString = "user id=" + this.textBox1.Text + ";data source=" + this.textBox4.Text + ";password="******"select 1 from dual");
                }
                else
                {
                    XmlHelper.Insert("/root/DBConfig", "DataSource", "", this.textBox5.Text);
                    XmlHelper.Insert("root/DBConfig", "TYPE", "", "sqlserver");
                    myConnString = "Initial Catalog=" + this.textBox4.Text + ";Data Source=" + this.textBox5.Text + ";User ID=" + this.textBox1.Text + "; Password="******"select 1");
                }
            }
            if (!Checked)
            {
                DialogResult dr = MessageBox.Show("更新包版本检查不通过,是否继续", "提示", MessageBoxButtons.OKCancel);
                if (dr != DialogResult.OK)
                {
                    return(false);
                }
            }


            cf = new CopyFileFrame();
            cf.servicespath = this.Parent.Tag as string;
            cf.bakToPath    = this.textBox2.Text;
            cf.Closing     += new CancelEventHandler(cf_Closing);
            cf.ShowDialog();


            return(true);
        }