?? formdepartmentmanagement.cs
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace BlueHill.BlueHillWindows.DepartmentManagement
{
/// <summary>
/// FormDepartmentManagement 的摘要說明。
/// </summary>
public class FormDepartmentManagement : System.Windows.Forms.Form
{
private System.Windows.Forms.TreeView treeView1;
private System.Windows.Forms.PictureBox QuitPic;
private System.Windows.Forms.PictureBox DeptDetailPic;
private System.Windows.Forms.PictureBox DeleteDeptPic;
private System.Windows.Forms.PictureBox AddDeptPic;
private System.Windows.Forms.Button btnQuit;
private System.Windows.Forms.Button btnDeptDetail;
private System.Windows.Forms.Button btnDeleteDept;
private System.Windows.Forms.Button btnAddDept;
/// <summary>
/// 必需的設計器變量。
/// </summary>
private System.ComponentModel.Container components = null;
public FormDepartmentManagement()
{
//
// Windows 窗體設計器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
//
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗體設計器生成的代碼
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.treeView1 = new System.Windows.Forms.TreeView();
this.QuitPic = new System.Windows.Forms.PictureBox();
this.DeptDetailPic = new System.Windows.Forms.PictureBox();
this.DeleteDeptPic = new System.Windows.Forms.PictureBox();
this.AddDeptPic = new System.Windows.Forms.PictureBox();
this.btnQuit = new System.Windows.Forms.Button();
this.btnDeptDetail = new System.Windows.Forms.Button();
this.btnDeleteDept = new System.Windows.Forms.Button();
this.btnAddDept = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// treeView1
//
this.treeView1.ImageIndex = -1;
this.treeView1.Location = new System.Drawing.Point(8, 16);
this.treeView1.Name = "treeView1";
this.treeView1.SelectedImageIndex = -1;
this.treeView1.Size = new System.Drawing.Size(136, 248);
this.treeView1.TabIndex = 0;
//
// QuitPic
//
this.QuitPic.Location = new System.Drawing.Point(168, 232);
this.QuitPic.Name = "QuitPic";
this.QuitPic.Size = new System.Drawing.Size(24, 16);
this.QuitPic.TabIndex = 16;
this.QuitPic.TabStop = false;
//
// DeptDetailPic
//
this.DeptDetailPic.Location = new System.Drawing.Point(168, 192);
this.DeptDetailPic.Name = "DeptDetailPic";
this.DeptDetailPic.Size = new System.Drawing.Size(24, 16);
this.DeptDetailPic.TabIndex = 15;
this.DeptDetailPic.TabStop = false;
//
// DeleteDeptPic
//
this.DeleteDeptPic.Location = new System.Drawing.Point(168, 152);
this.DeleteDeptPic.Name = "DeleteDeptPic";
this.DeleteDeptPic.Size = new System.Drawing.Size(24, 16);
this.DeleteDeptPic.TabIndex = 14;
this.DeleteDeptPic.TabStop = false;
//
// AddDeptPic
//
this.AddDeptPic.Location = new System.Drawing.Point(168, 112);
this.AddDeptPic.Name = "AddDeptPic";
this.AddDeptPic.Size = new System.Drawing.Size(24, 24);
this.AddDeptPic.TabIndex = 13;
this.AddDeptPic.TabStop = false;
//
// btnQuit
//
this.btnQuit.Location = new System.Drawing.Point(208, 232);
this.btnQuit.Name = "btnQuit";
this.btnQuit.TabIndex = 12;
this.btnQuit.Text = "退出";
this.btnQuit.Click += new System.EventHandler(this.btnQuit_Click);
//
// btnDeptDetail
//
this.btnDeptDetail.Location = new System.Drawing.Point(208, 192);
this.btnDeptDetail.Name = "btnDeptDetail";
this.btnDeptDetail.TabIndex = 11;
this.btnDeptDetail.Text = "部門明細";
this.btnDeptDetail.Click += new System.EventHandler(this.btnDeptDetail_Click);
//
// btnDeleteDept
//
this.btnDeleteDept.Location = new System.Drawing.Point(208, 152);
this.btnDeleteDept.Name = "btnDeleteDept";
this.btnDeleteDept.Size = new System.Drawing.Size(72, 24);
this.btnDeleteDept.TabIndex = 10;
this.btnDeleteDept.Text = "刪除部門";
this.btnDeleteDept.Click += new System.EventHandler(this.btnDeleteDept_Click);
//
// btnAddDept
//
this.btnAddDept.Location = new System.Drawing.Point(208, 112);
this.btnAddDept.Name = "btnAddDept";
this.btnAddDept.TabIndex = 9;
this.btnAddDept.Text = "增加部門";
this.btnAddDept.Click += new System.EventHandler(this.btnAddDept_Click);
//
// FormDepartmentManagement
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(296, 277);
this.Controls.Add(this.QuitPic);
this.Controls.Add(this.DeptDetailPic);
this.Controls.Add(this.DeleteDeptPic);
this.Controls.Add(this.AddDeptPic);
this.Controls.Add(this.btnQuit);
this.Controls.Add(this.btnDeptDetail);
this.Controls.Add(this.btnDeleteDept);
this.Controls.Add(this.btnAddDept);
this.Controls.Add(this.treeView1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "FormDepartmentManagement";
this.Text = "部門管理";
this.Load += new System.EventHandler(this.FormDepartmentManagement_Load);
this.ResumeLayout(false);
}
#endregion
private void btnQuit_Click(object sender, System.EventArgs e)
{
DialogResult result = MessageBox.Show("確定退出本窗口嗎?","MessageBox",
MessageBoxButtons.OKCancel);
switch(result)
{
case DialogResult.OK:
this.Close();
break;
case DialogResult.Cancel:
break;
}
}
private void btnAddDept_Click(object sender, System.EventArgs e)
{
FormAddDepartment frm2 = new FormAddDepartment();
frm2.ShowDialog();
}
private void btnDeptDetail_Click(object sender, System.EventArgs e)
{
if(this.treeView1.SelectedNode !=null)
{
FromDepartmentDetails frm3 = new FromDepartmentDetails(this.treeView1.SelectedNode.Text);
frm3.ShowDialog();
}
else
{
MessageBox.Show("請選擇一個部門!");
}
}
private void btnDeleteDept_Click(object sender, System.EventArgs e)
{
if(this.treeView1.SelectedNode !=null)
{
string str=this.treeView1.SelectedNode.Text;
FormMoveEmployeeToDepartment frm=new FormMoveEmployeeToDepartment(this.treeView1,str);
frm.ShowDialog();
}
else
{
MessageBox.Show("請選擇一個部門!");
}
}
private void FormDepartmentManagement_Load(object sender, System.EventArgs e)
{
DepartmentNode atrs = new DepartmentNode();
atrs.displaydept(this.treeView1);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -