日期:2014-05-18 浏览次数:21046 次
#region 工具栏单击事件 #region 表列表 /// <summary> /// 表列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ToolStripButtonDb_Click(object sender, EventArgs e) { TToolStripButton.Enabled = !TToolStripButton.Enabled; DbTable db = new DbTable(); db.Dock = DockStyle.Fill; this.TPanel.Controls.Clear(); this.TPanel.Controls.Add(db); this.TopLevel = true; TToolStripButton.Enabled = !TToolStripButton.Enabled; } #endregion #region 登录页面 /// <summary> /// 登录页面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TToolStripButton_Click(object sender, EventArgs e) { TToolStripButton.Enabled = !TToolStripButton.Enabled; Db db = new Db(); db.Finish += new Db.EventHandler(db_Finish); db.Dock = DockStyle.Fill; this.TPanel.Controls.Clear(); this.TPanel.Controls.Add(db); this.TopLevel = true; TToolStripButton.Enabled = !TToolStripButton.Enabled; } #endregion #region 连接上数据库后 /// <summary> /// 登录完成后 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void db_Finish(object sender, DbEventArgs e) { //显示当前数据库连接 lbInfo.Text = string.Format("当前连接,{0}", e.UserInfo.ServerName); SqlManagement s = new SqlManagement(); s.Dock = DockStyle.Fill; this.TPanel.Controls.Clear(); this.TPanel.Controls.Add(s); this.TopLevel = true; } #endregion #region 生成代码 /// <summary> /// 生成代码 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ToolStripButtonCreate_Click(object sender, EventArgs e) { ToolStripButtonCreate.Enabled = !ToolStripButtonCreate.Enabled; DbCreate dbCreate = new DbCreate(); dbCreate.Dock = DockStyle.Fill; this.TPanel.Controls.Clear(); this.TPanel.Controls.Add(