/// <summary> /// 新建 /// </summary> private void dbconn_new_Click(object sender, EventArgs e) { create_conn ccn = new create_conn(); if (ccn.ShowDialog(this) == DialogResult.OK) //当登窗体的对话框的返回值为OK时 { this.dbconn_comb.Text = PublicValue.dbname; this.dbconn_ipaddr.Text = "localhost"; this.dbconn_username.Text = "root"; this.dbconn_port.Text = "3306"; init3_views(); } }
/// <summary> /// 克隆 /// </summary> private void dbconn_clone_Click(object sender, EventArgs e) { string tmp = this.dbconn_comb.Text.Trim(); PublicValue.old_dbname = tmp; create_conn ccn = new create_conn(); if (ccn.ShowDialog(this) == DialogResult.OK) //当登窗体的对话框的返回值为OK时 { this.dbconn_comb.Text = PublicValue.dbname; this.dbconn_ipaddr.Text = getKeyExistsDics(tmp).ipaddr; this.dbconn_username.Text = getKeyExistsDics(tmp).username; this.dbconn_port.Text = getKeyExistsDics(tmp).port.ToString(); init3_views(); } }
/// <summary> /// 重命名 /// </summary> private void dbconn_rename_Click(object sender, EventArgs e) { DB_Map tmp = new DB_Map(this.dbconn_comb.Text.Trim(), this.dbconn_username.Text.Trim(), this.dbconn_password.Text.Trim(), this.dbconn_ipaddr.Text.Trim(), Convert.ToInt32(this.dbconn_port.Text.Trim()), 0, "否", Publec_Class.UserName); create_conn ccn = new create_conn(); if (ccn.ShowDialog(this) == DialogResult.OK) //当登窗体的对话框的返回值为OK时 { this.dbconn_comb.Text = PublicValue.dbname; this.dbconn_ipaddr.Text = tmp.ipaddr; this.dbconn_username.Text = tmp.username; this.dbconn_password.Text = tmp.password; this.dbconn_port.Text = tmp.port.ToString(); dbconn_replace_dbname(tmp, PublicValue.dbname); init4_views(); } }