⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formdepartmentmanagement.cs

📁 蓝山人事管理系统
💻 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 + -