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

📄 cleartableframe.cs

📁 独立完成考勤管理软件加打卡系统(C#) 是打卡加管理系统软件 
💻 CS
字号:
#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
{
	public class ClearTableFrame : System.Windows.Forms.Form
	{
		#region Control....
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.GroupBox clearGroup;
		private System.Windows.Forms.Button btn_ClearEmp_Time;
		private System.Windows.Forms.ImageList imageList1;
		private System.Windows.Forms.Button btnClearEmployee_Late;
		private System.Windows.Forms.Button btnClear_Employee_UnCome;
		private System.Windows.Forms.Button btnEmp_ZhaoTui;
		private System.Windows.Forms.Button btnClearEmp_LeaveTable;
		private System.Windows.Forms.Button btnClearText;
		private System.ComponentModel.IContainer components;
		#endregion
		#region Function...
		public ClearTableFrame()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

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

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		#endregion
		#region Data....
		ConnectionData conn=new ConnectionData();
		#endregion
		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ClearTableFrame));
			this.label1 = new System.Windows.Forms.Label();
			this.clearGroup = new System.Windows.Forms.GroupBox();
			this.btn_ClearEmp_Time = new System.Windows.Forms.Button();
			this.imageList1 = new System.Windows.Forms.ImageList(this.components);
			this.btnClearEmployee_Late = new System.Windows.Forms.Button();
			this.btnClear_Employee_UnCome = new System.Windows.Forms.Button();
			this.btnClearEmp_LeaveTable = new System.Windows.Forms.Button();
			this.btnClearText = new System.Windows.Forms.Button();
			this.btnEmp_ZhaoTui = new System.Windows.Forms.Button();
			this.clearGroup.SuspendLayout();
			this.SuspendLayout();
			// 
			// label1
			// 
			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.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.label1.Location = new System.Drawing.Point(0, 0);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(376, 32);
			this.label1.TabIndex = 0;
			this.label1.Text = "清除表记录";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// clearGroup
			// 
			this.clearGroup.Controls.Add(this.btnClearEmp_LeaveTable);
			this.clearGroup.Controls.Add(this.btnClearText);
			this.clearGroup.Controls.Add(this.btnEmp_ZhaoTui);
			this.clearGroup.Controls.Add(this.btnClear_Employee_UnCome);
			this.clearGroup.Controls.Add(this.btnClearEmployee_Late);
			this.clearGroup.Controls.Add(this.btn_ClearEmp_Time);
			this.clearGroup.Cursor = System.Windows.Forms.Cursors.Hand;
			this.clearGroup.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.clearGroup.ForeColor = System.Drawing.Color.Blue;
			this.clearGroup.Location = new System.Drawing.Point(8, 40);
			this.clearGroup.Name = "clearGroup";
			this.clearGroup.Size = new System.Drawing.Size(360, 192);
			this.clearGroup.TabIndex = 1;
			this.clearGroup.TabStop = false;
			this.clearGroup.Text = "表记录";
			// 
			// btn_ClearEmp_Time
			// 
			this.btn_ClearEmp_Time.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btn_ClearEmp_Time.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btn_ClearEmp_Time.ImageIndex = 1;
			this.btn_ClearEmp_Time.ImageList = this.imageList1;
			this.btn_ClearEmp_Time.Location = new System.Drawing.Point(32, 40);
			this.btn_ClearEmp_Time.Name = "btn_ClearEmp_Time";
			this.btn_ClearEmp_Time.Size = new System.Drawing.Size(128, 24);
			this.btn_ClearEmp_Time.TabIndex = 0;
			this.btn_ClearEmp_Time.Text = "Emp_Time(&E)";
			this.btn_ClearEmp_Time.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btn_ClearEmp_Time.Click += new System.EventHandler(this.btn_ClearEmp_Time_Click);
			this.btn_ClearEmp_Time.MouseEnter += new System.EventHandler(this.btn_ClearEmp_Time_MouseEnter);
			this.btn_ClearEmp_Time.MouseLeave += new System.EventHandler(this.btn_ClearEmp_Time_MouseLeave);
			// 
			// imageList1
			// 
			this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
			this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
			this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// btnClearEmployee_Late
			// 
			this.btnClearEmployee_Late.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnClearEmployee_Late.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnClearEmployee_Late.ImageIndex = 3;
			this.btnClearEmployee_Late.ImageList = this.imageList1;
			this.btnClearEmployee_Late.Location = new System.Drawing.Point(32, 84);
			this.btnClearEmployee_Late.Name = "btnClearEmployee_Late";
			this.btnClearEmployee_Late.Size = new System.Drawing.Size(128, 24);
			this.btnClearEmployee_Late.TabIndex = 1;
			this.btnClearEmployee_Late.Text = "Employee_Late(&L)";
			this.btnClearEmployee_Late.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnClearEmployee_Late.Click += new System.EventHandler(this.btnClearEmployee_Late_Click);
			this.btnClearEmployee_Late.MouseEnter += new System.EventHandler(this.btn_ClearEmp_Time_MouseEnter);
			this.btnClearEmployee_Late.MouseLeave += new System.EventHandler(this.btn_ClearEmp_Time_MouseLeave);
			// 
			// btnClear_Employee_UnCome
			// 
			this.btnClear_Employee_UnCome.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnClear_Employee_UnCome.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnClear_Employee_UnCome.ImageIndex = 2;
			this.btnClear_Employee_UnCome.ImageList = this.imageList1;
			this.btnClear_Employee_UnCome.Location = new System.Drawing.Point(32, 128);
			this.btnClear_Employee_UnCome.Name = "btnClear_Employee_UnCome";
			this.btnClear_Employee_UnCome.Size = new System.Drawing.Size(128, 24);
			this.btnClear_Employee_UnCome.TabIndex = 2;
			this.btnClear_Employee_UnCome.Text = "Emp_UnCome(&E)";
			this.btnClear_Employee_UnCome.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnClear_Employee_UnCome.Click += new System.EventHandler(this.btnClear_Employee_UnCome_Click);
			this.btnClear_Employee_UnCome.MouseEnter += new System.EventHandler(this.btn_ClearEmp_Time_MouseEnter);
			this.btnClear_Employee_UnCome.MouseLeave += new System.EventHandler(this.btn_ClearEmp_Time_MouseLeave);
			// 
			// btnClearEmp_LeaveTable
			// 
			this.btnClearEmp_LeaveTable.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnClearEmp_LeaveTable.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnClearEmp_LeaveTable.ImageIndex = 5;
			this.btnClearEmp_LeaveTable.ImageList = this.imageList1;
			this.btnClearEmp_LeaveTable.Location = new System.Drawing.Point(192, 128);
			this.btnClearEmp_LeaveTable.Name = "btnClearEmp_LeaveTable";
			this.btnClearEmp_LeaveTable.Size = new System.Drawing.Size(136, 24);
			this.btnClearEmp_LeaveTable.TabIndex = 5;
			this.btnClearEmp_LeaveTable.Text = "Emp_LeaveTable(&E)";
			this.btnClearEmp_LeaveTable.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnClearEmp_LeaveTable.Click += new System.EventHandler(this.btnClearEmp_LeaveTable_Click);
			this.btnClearEmp_LeaveTable.MouseEnter += new System.EventHandler(this.btn_ClearEmp_Time_MouseEnter);
			this.btnClearEmp_LeaveTable.MouseLeave += new System.EventHandler(this.btn_ClearEmp_Time_MouseLeave);
			// 
			// btnClearText
			// 
			this.btnClearText.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnClearText.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnClearText.ImageIndex = 4;
			this.btnClearText.ImageList = this.imageList1;
			this.btnClearText.Location = new System.Drawing.Point(192, 84);
			this.btnClearText.Name = "btnClearText";
			this.btnClearText.Size = new System.Drawing.Size(128, 24);
			this.btnClearText.TabIndex = 4;
			this.btnClearText.Text = "Emp_BrushID(&B)";
			this.btnClearText.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnClearText.Click += new System.EventHandler(this.btnClearText_Click);
			this.btnClearText.MouseEnter += new System.EventHandler(this.btn_ClearEmp_Time_MouseEnter);
			this.btnClearText.MouseLeave += new System.EventHandler(this.btn_ClearEmp_Time_MouseLeave);
			// 
			// btnEmp_ZhaoTui
			// 
			this.btnEmp_ZhaoTui.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnEmp_ZhaoTui.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnEmp_ZhaoTui.ImageIndex = 0;
			this.btnEmp_ZhaoTui.ImageList = this.imageList1;
			this.btnEmp_ZhaoTui.Location = new System.Drawing.Point(192, 40);
			this.btnEmp_ZhaoTui.Name = "btnEmp_ZhaoTui";
			this.btnEmp_ZhaoTui.Size = new System.Drawing.Size(128, 24);
			this.btnEmp_ZhaoTui.TabIndex = 3;
			this.btnEmp_ZhaoTui.Text = "Emp_ZhaoTui(&Z)";
			this.btnEmp_ZhaoTui.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnEmp_ZhaoTui.Click += new System.EventHandler(this.btnEmp_ZhaoTui_Click);
			this.btnEmp_ZhaoTui.MouseEnter += new System.EventHandler(this.btn_ClearEmp_Time_MouseEnter);
			this.btnEmp_ZhaoTui.MouseLeave += new System.EventHandler(this.btn_ClearEmp_Time_MouseLeave);
			// 
			// ClearTableFrame
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.ClientSize = new System.Drawing.Size(374, 243);
			this.Controls.Add(this.clearGroup);
			this.Controls.Add(this.label1);
			this.Cursor = System.Windows.Forms.Cursors.Hand;
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "ClearTableFrame";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "ClearTableFrame";
			this.clearGroup.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion
		#region ClearTable记录...
		private void btn_ClearEmp_Time_Click(object sender, System.EventArgs e)
		{
			try
			{
                int a=conn.ExcuteStrSql("delete from Emp_Time");
				if(a>0)
				{}
				else
				{
					MessageBox.Show(this,"删除失败啊!!!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
				}
			}
			catch(Exception ele)
			{
				MessageBox.Show(this,ele.ToString(),"提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
		}

		private void btnClearEmployee_Late_Click(object sender, System.EventArgs e)
		{
			int b=conn.ExcuteStrSql("delete from Employee_Late");
			if(b>0)
			{}
			else
			{
				MessageBox.Show(this,"删除失败啊!!!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
		}

		private void btnClear_Employee_UnCome_Click(object sender, System.EventArgs e)
		{
			int c=conn.ExcuteStrSql("delete from Employee_UnCome");
			if(c>0)
			{}
			else
			{
				MessageBox.Show(this,"删除失败啊!!!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
		}

		private void btnEmp_ZhaoTui_Click(object sender, System.EventArgs e)
		{
			int d=conn.ExcuteStrSql("delete from Emp_ZhaoTui");
			if(d>0)
			{}
			else
			{
				MessageBox.Show(this,"删除失败啊!!!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
		}

		private void btnClearText_Click(object sender, System.EventArgs e)
		{
			int f=conn.ExcuteStrSql("delete from Emp_BrushID");
			if(f>0)
			{}
			else
			{
				MessageBox.Show(this,"删除失败啊!!!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
		}

		private void btnClearEmp_LeaveTable_Click(object sender, System.EventArgs e)
		{
			int g=conn.ExcuteStrSql("delete from Employee_LeaveTable");
			if(g>0)
			{}
			else
			{
				MessageBox.Show(this,"删除失败啊!!!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
		}
		#endregion
		#region Cusor Move Event....
		private void btn_ClearEmp_Time_MouseLeave(object sender, System.EventArgs e)
		{
		    WindowsApplication.MouseStyle.ButtonStyle.MouseLeaved(sender,e);
		}

		private void btn_ClearEmp_Time_MouseEnter(object sender, System.EventArgs e)
		{
		    WindowsApplication.MouseStyle.ButtonStyle.MouseEntered(sender,e);
		}
		#endregion
	}
}

⌨️ 快捷键说明

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