employeeleavemanager.cs

来自「独立完成考勤管理软件加打卡系统(C#) 是打卡加管理系统软件 」· CS 代码 · 共 525 行 · 第 1/2 页

CS
525
字号
#region 命名空间
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
#endregion
namespace WindowsApplication.EmployeeLeaveManager
{
	#region EmployeeLeaveManager Class
	public class EmployeeLeaveManager : System.Windows.Forms.Form
	{
		#region 控件集合....
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.ComboBox textEmployeeName;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.ComboBox textCourseCom;
		private System.Windows.Forms.TextBox textReason;
		private System.Windows.Forms.Button btnOk;
		private System.Windows.Forms.Button btnHistory;
		private System.Windows.Forms.Button btnCancel;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.TextBox textLeaveDays;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;
		#endregion
		#region 构造函数...
		public EmployeeLeaveManager()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		#endregion
		#region 数据库变量...
		private ConnectionData conn=new ConnectionData();
		private DataTable UnCometable=new DataTable();
		#endregion
		#region 变量...
		private string strUnComeSql="";
		#endregion
		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(EmployeeLeaveManager));
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.textEmployeeName = new System.Windows.Forms.ComboBox();
			this.textCourseCom = new System.Windows.Forms.ComboBox();
			this.label4 = new System.Windows.Forms.Label();
			this.textReason = new System.Windows.Forms.TextBox();
			this.btnOk = new System.Windows.Forms.Button();
			this.btnHistory = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.label3 = new System.Windows.Forms.Label();
			this.textLeaveDays = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.label1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label1.ForeColor = System.Drawing.Color.White;
			this.label1.Location = new System.Drawing.Point(0, 0);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(408, 40);
			this.label1.TabIndex = 0;
			this.label1.Text = "请假管理";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label2
			// 
			this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.label2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label2.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.label2.Location = new System.Drawing.Point(40, 64);
			this.label2.Name = "label2";
			this.label2.TabIndex = 1;
			this.label2.Text = "职工名称:";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// textEmployeeName
			// 
			this.textEmployeeName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
			this.textEmployeeName.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.textEmployeeName.Location = new System.Drawing.Point(152, 64);
			this.textEmployeeName.Name = "textEmployeeName";
			this.textEmployeeName.Size = new System.Drawing.Size(168, 20);
			this.textEmployeeName.TabIndex = 2;
			this.textEmployeeName.MouseEnter += new System.EventHandler(this.textEmployeeName_MouseEnter);
			this.textEmployeeName.MouseLeave += new System.EventHandler(this.textEmployeeName_MouseLeave);
			// 
			// textCourseCom
			// 
			this.textCourseCom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
			this.textCourseCom.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.textCourseCom.Items.AddRange(new object[] {
															   "事假",
															   "公假(不属于请假)",
															   "病假",
															   "其他"});
			this.textCourseCom.Location = new System.Drawing.Point(152, 112);
			this.textCourseCom.Name = "textCourseCom";
			this.textCourseCom.Size = new System.Drawing.Size(168, 20);
			this.textCourseCom.TabIndex = 4;
			this.textCourseCom.SelectedIndexChanged += new System.EventHandler(this.textCourseCom_SelectedIndexChanged);
			this.textCourseCom.MouseEnter += new System.EventHandler(this.textCourseCom_MouseEnter);
			this.textCourseCom.MouseLeave += new System.EventHandler(this.textCourseCom_MouseLeave);
			// 
			// label4
			// 
			this.label4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.label4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label4.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.label4.Location = new System.Drawing.Point(40, 160);
			this.label4.Name = "label4";
			this.label4.TabIndex = 5;
			this.label4.Text = "其他:";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// textReason
			// 
			this.textReason.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.textReason.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.textReason.Location = new System.Drawing.Point(152, 160);
			this.textReason.Name = "textReason";
			this.textReason.Size = new System.Drawing.Size(168, 21);
			this.textReason.TabIndex = 6;
			this.textReason.Text = "";
			// 
			// btnOk
			// 
			this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnOk.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.btnOk.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.btnOk.Location = new System.Drawing.Point(56, 256);
			this.btnOk.Name = "btnOk";
			this.btnOk.TabIndex = 7;
			this.btnOk.Text = "确定(&O)";
			this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
			this.btnOk.MouseEnter += new System.EventHandler(this.btnOk_MouseEnter);
			this.btnOk.MouseLeave += new System.EventHandler(this.btnOk_MouseLeave);
			// 
			// btnHistory
			// 
			this.btnHistory.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnHistory.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.btnHistory.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.btnHistory.Location = new System.Drawing.Point(168, 256);
			this.btnHistory.Name = "btnHistory";
			this.btnHistory.TabIndex = 8;
			this.btnHistory.Text = "记录(&H)";
			this.btnHistory.Click += new System.EventHandler(this.btnHistory_Click);
			this.btnHistory.MouseEnter += new System.EventHandler(this.btnOk_MouseEnter);
			this.btnHistory.MouseLeave += new System.EventHandler(this.btnOk_MouseLeave);
			// 
			// btnCancel
			// 
			this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnCancel.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.btnCancel.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.btnCancel.Location = new System.Drawing.Point(280, 256);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.TabIndex = 9;
			this.btnCancel.Text = "取消(&C)";
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			this.btnCancel.MouseEnter += new System.EventHandler(this.btnOk_MouseEnter);
			this.btnCancel.MouseLeave += new System.EventHandler(this.btnOk_MouseLeave);
			// 
			// label3
			// 
			this.label3.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.label3.Cursor = System.Windows.Forms.Cursors.Hand;
			this.label3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.label3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label3.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.label3.Location = new System.Drawing.Point(40, 112);
			this.label3.Name = "label3";
			this.label3.TabIndex = 3;
			this.label3.Text = "请假原因:";
			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// textLeaveDays
			// 
			this.textLeaveDays.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.textLeaveDays.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.textLeaveDays.Location = new System.Drawing.Point(152, 208);
			this.textLeaveDays.Name = "textLeaveDays";
			this.textLeaveDays.Size = new System.Drawing.Size(72, 21);
			this.textLeaveDays.TabIndex = 10;
			this.textLeaveDays.Text = "0";
			this.textLeaveDays.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
			// 
			// label5
			// 
			this.label5.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.label5.Cursor = System.Windows.Forms.Cursors.Hand;
			this.label5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.label5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label5.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.label5.Location = new System.Drawing.Point(48, 208);
			this.label5.Name = "label5";
			this.label5.TabIndex = 11;
			this.label5.Text = "请假天数:";
			this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label6
			// 
			this.label6.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.label6.Cursor = System.Windows.Forms.Cursors.Hand;
			this.label6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label6.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(128)), ((System.Byte)(128)));
			this.label6.Location = new System.Drawing.Point(240, 208);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(128, 23);
			this.label6.TabIndex = 12;
			this.label6.Text = "天| 如非未假输入0值";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// EmployeeLeaveManager
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.ClientSize = new System.Drawing.Size(402, 303);
			this.Controls.Add(this.label6);

⌨️ 快捷键说明

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