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

📄 formsalarymanagement.cs

📁 蓝山人事管理系统
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data ;

namespace BlueHill.BlueHillWindows.SalaryManagement
{
	/// <summary>
	/// FormSalaryManagement 的摘要说明。
	/// </summary>
	public class FormSalaryManagement : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button btnQueryEmp;
		private System.Windows.Forms.Button btnHistoryQuery;
		private System.Windows.Forms.Button btnGroupbyDept;
		private System.Windows.Forms.Button btnOK;
		private System.Windows.Forms.Button btnSetting;
		

		Salary sm=new Salary ();
		private System.Windows.Forms.DataGrid grdSalaryList;
		private System.ComponentModel.Container components = null;

		public FormSalaryManagement()
		{
			
			InitializeComponent();

		}

	
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		
		private void InitializeComponent()
		{
			this.btnQueryEmp = new System.Windows.Forms.Button();
			this.btnHistoryQuery = new System.Windows.Forms.Button();
			this.btnGroupbyDept = new System.Windows.Forms.Button();
			this.btnOK = new System.Windows.Forms.Button();
			this.btnSetting = new System.Windows.Forms.Button();
			this.grdSalaryList = new System.Windows.Forms.DataGrid();
			((System.ComponentModel.ISupportInitialize)(this.grdSalaryList)).BeginInit();
			this.SuspendLayout();
			// 
			// btnQueryEmp
			// 
			this.btnQueryEmp.Location = new System.Drawing.Point(40, 8);
			this.btnQueryEmp.Name = "btnQueryEmp";
			this.btnQueryEmp.TabIndex = 0;
			this.btnQueryEmp.Text = "员工查询";
			this.btnQueryEmp.Click += new System.EventHandler(this.btnQueryEmp_Click);
			// 
			// btnHistoryQuery
			// 
			this.btnHistoryQuery.Location = new System.Drawing.Point(144, 8);
			this.btnHistoryQuery.Name = "btnHistoryQuery";
			this.btnHistoryQuery.TabIndex = 1;
			this.btnHistoryQuery.Text = "历史查询";
			this.btnHistoryQuery.Click += new System.EventHandler(this.btnHistoryQuery_Click);
			// 
			// btnGroupbyDept
			// 
			this.btnGroupbyDept.Location = new System.Drawing.Point(240, 8);
			this.btnGroupbyDept.Name = "btnGroupbyDept";
			this.btnGroupbyDept.TabIndex = 2;
			this.btnGroupbyDept.Text = "部门汇总";
			this.btnGroupbyDept.Click += new System.EventHandler(this.btnGroupbyDept_Click);
			// 
			// btnOK
			// 
			this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.btnOK.Location = new System.Drawing.Point(40, 336);
			this.btnOK.Name = "btnOK";
			this.btnOK.TabIndex = 7;
			this.btnOK.Text = "确定";
			this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
			// 
			// btnSetting
			// 
			this.btnSetting.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.btnSetting.Location = new System.Drawing.Point(256, 336);
			this.btnSetting.Name = "btnSetting";
			this.btnSetting.TabIndex = 6;
			this.btnSetting.Text = "设定薪资";
			this.btnSetting.Click += new System.EventHandler(this.btnSetting_Click);
			// 
			// grdSalaryList
			// 
			this.grdSalaryList.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
			this.grdSalaryList.CaptionBackColor = System.Drawing.Color.Blue;
			this.grdSalaryList.CaptionFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.grdSalaryList.CaptionForeColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.grdSalaryList.CaptionText = "薪资列表";
			this.grdSalaryList.DataMember = "";
			this.grdSalaryList.ForeColor = System.Drawing.Color.Blue;
			this.grdSalaryList.GridLineColor = System.Drawing.Color.DimGray;
			this.grdSalaryList.HeaderBackColor = System.Drawing.SystemColors.ControlText;
			this.grdSalaryList.HeaderForeColor = System.Drawing.SystemColors.ControlLight;
			this.grdSalaryList.ImeMode = System.Windows.Forms.ImeMode.On;
			this.grdSalaryList.LinkColor = System.Drawing.Color.Lavender;
			this.grdSalaryList.Location = new System.Drawing.Point(24, 40);
			this.grdSalaryList.Name = "grdSalaryList";
			this.grdSalaryList.ParentRowsBackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
			this.grdSalaryList.ParentRowsForeColor = System.Drawing.SystemColors.InfoText;
			this.grdSalaryList.SelectionBackColor = System.Drawing.Color.Firebrick;
			this.grdSalaryList.SelectionForeColor = System.Drawing.SystemColors.ControlText;
			this.grdSalaryList.Size = new System.Drawing.Size(296, 280);
			this.grdSalaryList.TabIndex = 5;
			// 
			// FormSalaryManagement
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.SystemColors.ControlLight;
			this.ClientSize = new System.Drawing.Size(360, 365);
			this.Controls.Add(this.grdSalaryList);
			this.Controls.Add(this.btnSetting);
			this.Controls.Add(this.btnOK);
			this.Controls.Add(this.btnGroupbyDept);
			this.Controls.Add(this.btnHistoryQuery);
			this.Controls.Add(this.btnQueryEmp);
			this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.ForeColor = System.Drawing.SystemColors.ControlText;
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Name = "FormSalaryManagement";
			this.Text = "薪资管理";
			this.Load += new System.EventHandler(this.FormSalaryManagement_Load);
			((System.ComponentModel.ISupportInitialize)(this.grdSalaryList)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		[STAThread]
		static void Main() 
		{
			Application.Run(new FormSalaryManagement());
		}

        
		private void FormSalaryManagement_Load(object sender, System.EventArgs e)
		{
			DataTable dt=sm.GetBasicSalary ();
			grdSalaryList.DataSource =dt;

		}


		private void btnQueryEmp_Click(object sender, System.EventArgs e)
		{
			FormQueryEmployee frm = new FormQueryEmployee ();

			if(frm.ShowDialog ()==DialogResult.OK )
			{
				this.grdSalaryList .DataSource =frm.table ;
			}
		
		}
		

	

		private void btnGroupbyDept_Click(object sender, System.EventArgs e)
		{

		    FormDepartmentSum fds=new FormDepartmentSum ();
			
			fds.ShowDialog ();

		
		}

		private void btnSetting_Click(object sender, System.EventArgs e)
		{

			string str=this.grdSalaryList [grdSalaryList.CurrentCell.RowNumber ,0].ToString ();
			int deptId=System.Convert .ToInt32(str);
			FormSettingSalary bs=new FormSettingSalary (deptId);
			this.Hide ();
			bs.Show ();

		}

		private void btnHistoryQuery_Click(object sender, System.EventArgs e)
		{
			FormEmployeeHistory feh=new FormEmployeeHistory (this.grdSalaryList [grdSalaryList.CurrentCell .RowNumber ,0].ToString ());
			feh.Show ();
		}

		private void btnOK_Click(object sender, System.EventArgs e)
		{
			this.Close ();
		}

	
	
	
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -