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

📄 brushkaidframe.cs

📁 独立完成考勤管理软件加打卡系统(C#) 是打卡加管理系统软件 
💻 CS
📖 第 1 页 / 共 5 页
字号:
#region 命名空间...
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data;
using System.Globalization;
using System.Data.OleDb;
using WindowsApplication.ReturnDateTime;
#endregion
namespace WindowsApplication.BrushKaID
{
	public class BrushKaIDFrame : System.Windows.Forms.Form
	{
		#region 控件集合...
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Button btnOpen;
		private System.Windows.Forms.Button btnClose;
		private System.Windows.Forms.MenuItem menuClose;
		private System.Windows.Forms.ContextMenu contextMenu;
		private System.Windows.Forms.ToolTip toolTip;
		private System.Windows.Forms.ImageList imageList;
		private System.Windows.Forms.TextBox textBrushText;
		private System.Windows.Forms.Label TitleLabel;
		private System.Windows.Forms.Timer CurrentTime;
		private System.Windows.Forms.PictureBox prictureBox;
		private System.Windows.Forms.Label StitictisLabel;
		private System.Windows.Forms.Label TimeLabel;
		private System.Windows.Forms.Label DateLabel;
		private System.Windows.Forms.Label stautsLabel;
		private System.Windows.Forms.MenuItem menuExitSystem;
		public  static string strID="";
		public  static string BrushIDStr="";
		public  static int brushUnCount=0;
		public  static string strZhuChe="";
		public  static int brushZhuChe=0;
		public  static int p=0;
		private System.ComponentModel.IContainer components;
		#endregion
		#region 变量定义...鼠标坐标位置变量
		private bool blMove=false;
		private int MouseX,MouseY;
		private System.Windows.Forms.Button btnClear;
		private int brushCount=0;
		public static int BrushCounts=0;
		private System.Windows.Forms.TextBox textBox;
		private System.Windows.Forms.Label NameText;
		private System.Windows.Forms.TextBox textName;
		private System.Windows.Forms.Label label1;
		public static string strText="";
		private System.Windows.Forms.TextBox textTextText;
		private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter;
		private System.Data.SqlClient.SqlConnection sqlConnection;
		private WindowsApplication.BrushKaID.BrushIDSet brushIDSet;

		private System.Windows.Forms.ListBox textListBox;
		private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
		private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
		private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
		private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
		private AxMSCommLib.AxMSComm axMSComm1;
		private System.Windows.Forms.ListBox tListBox;
		private System.Windows.Forms.Label UnZhuCheLabel;
		private System.Windows.Forms.ListBox tZhuCheListBox;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label tZhuCheLabel;
		private System.Windows.Forms.Timer ControlTime;
		private System.Windows.Forms.TextBox textBox1;
		private System.Windows.Forms.ListBox listBox;
		private System.Windows.Forms.Button btnOpenPort;
		private System.Windows.Forms.Label label4;
		private AxMSCommLib.AxMSComm axMSComm2;
		
		public static string empStr="";
		#endregion
		#region 构造函数...
		public BrushKaIDFrame()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

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

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		#endregion
		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(BrushKaIDFrame));
			this.TitleLabel = new System.Windows.Forms.Label();
			this.prictureBox = new System.Windows.Forms.PictureBox();
			this.label2 = new System.Windows.Forms.Label();
			this.textBrushText = new System.Windows.Forms.TextBox();
			this.stautsLabel = new System.Windows.Forms.Label();
			this.StitictisLabel = new System.Windows.Forms.Label();
			this.TimeLabel = new System.Windows.Forms.Label();
			this.DateLabel = new System.Windows.Forms.Label();
			this.btnOpen = new System.Windows.Forms.Button();
			this.imageList = new System.Windows.Forms.ImageList(this.components);
			this.btnClose = new System.Windows.Forms.Button();
			this.contextMenu = new System.Windows.Forms.ContextMenu();
			this.menuClose = new System.Windows.Forms.MenuItem();
			this.menuExitSystem = new System.Windows.Forms.MenuItem();
			this.toolTip = new System.Windows.Forms.ToolTip(this.components);
			this.CurrentTime = new System.Windows.Forms.Timer(this.components);
			this.btnClear = new System.Windows.Forms.Button();
			this.textBox = new System.Windows.Forms.TextBox();
			this.NameText = new System.Windows.Forms.Label();
			this.textName = new System.Windows.Forms.TextBox();
			this.label1 = new System.Windows.Forms.Label();
			this.textTextText = new System.Windows.Forms.TextBox();
			this.sqlDataAdapter = new System.Data.SqlClient.SqlDataAdapter();
			this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlConnection = new System.Data.SqlClient.SqlConnection();
			this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
			this.brushIDSet = new WindowsApplication.BrushKaID.BrushIDSet();
			this.textListBox = new System.Windows.Forms.ListBox();
			this.tListBox = new System.Windows.Forms.ListBox();
			this.UnZhuCheLabel = new System.Windows.Forms.Label();
			this.tZhuCheListBox = new System.Windows.Forms.ListBox();
			this.label3 = new System.Windows.Forms.Label();
			this.tZhuCheLabel = new System.Windows.Forms.Label();
			this.ControlTime = new System.Windows.Forms.Timer(this.components);
			this.textBox1 = new System.Windows.Forms.TextBox();
			this.listBox = new System.Windows.Forms.ListBox();
			this.btnOpenPort = new System.Windows.Forms.Button();
			this.label4 = new System.Windows.Forms.Label();
			this.axMSComm2 = new AxMSCommLib.AxMSComm();
			((System.ComponentModel.ISupportInitialize)(this.brushIDSet)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.axMSComm2)).BeginInit();
			this.SuspendLayout();
			// 
			// TitleLabel
			// 
			this.TitleLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.TitleLabel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.TitleLabel.Cursor = System.Windows.Forms.Cursors.Hand;
			this.TitleLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.TitleLabel.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.TitleLabel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.TitleLabel.Location = new System.Drawing.Point(0, 0);
			this.TitleLabel.Name = "TitleLabel";
			this.TitleLabel.Size = new System.Drawing.Size(558, 40);
			this.TitleLabel.TabIndex = 0;
			this.TitleLabel.Text = "刷卡处理程序";
			this.TitleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.TitleLabel.MouseUp += new System.Windows.Forms.MouseEventHandler(this.TitleLabel_MouseUp);
			this.TitleLabel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.TitleLabel_MouseMove);
			this.TitleLabel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TitleLabel_MouseDown);
			// 
			// prictureBox
			// 
			this.prictureBox.Image = ((System.Drawing.Image)(resources.GetObject("prictureBox.Image")));
			this.prictureBox.Location = new System.Drawing.Point(-8, 40);
			this.prictureBox.Name = "prictureBox";
			this.prictureBox.Size = new System.Drawing.Size(160, 160);
			this.prictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
			this.prictureBox.TabIndex = 1;
			this.prictureBox.TabStop = false;
			// 
			// label2
			// 
			this.label2.ForeColor = System.Drawing.Color.Blue;
			this.label2.Location = new System.Drawing.Point(152, 48);
			this.label2.Name = "label2";
			this.label2.TabIndex = 2;
			this.label2.Text = "接收卡区:";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// textBrushText
			// 
			this.textBrushText.BackColor = System.Drawing.Color.White;
			this.textBrushText.Cursor = System.Windows.Forms.Cursors.Hand;
			this.textBrushText.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.textBrushText.Location = new System.Drawing.Point(176, 80);
			this.textBrushText.Multiline = true;
			this.textBrushText.Name = "textBrushText";
			this.textBrushText.ReadOnly = true;
			this.textBrushText.ScrollBars = System.Windows.Forms.ScrollBars.Both;
			this.textBrushText.Size = new System.Drawing.Size(192, 176);
			this.textBrushText.TabIndex = 3;
			this.textBrushText.Text = "";
			this.textBrushText.TextChanged += new System.EventHandler(this.textBrushText_TextChanged);
			// 
			// stautsLabel
			// 
			this.stautsLabel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.stautsLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.stautsLabel.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.stautsLabel.Location = new System.Drawing.Point(0, 352);
			this.stautsLabel.Name = "stautsLabel";
			this.stautsLabel.Size = new System.Drawing.Size(600, 40);
			this.stautsLabel.TabIndex = 4;
			// 
			// StitictisLabel
			// 
			this.StitictisLabel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.StitictisLabel.Cursor = System.Windows.Forms.Cursors.Hand;
			this.StitictisLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.StitictisLabel.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.StitictisLabel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.StitictisLabel.Location = new System.Drawing.Point(288, 360);
			this.StitictisLabel.Name = "StitictisLabel";
			this.StitictisLabel.Size = new System.Drawing.Size(112, 23);
			this.StitictisLabel.TabIndex = 5;
			this.StitictisLabel.Text = "统计总数:";
			this.StitictisLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// TimeLabel
			// 
			this.TimeLabel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.TimeLabel.Cursor = System.Windows.Forms.Cursors.Hand;
			this.TimeLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.TimeLabel.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.TimeLabel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.TimeLabel.Location = new System.Drawing.Point(160, 360);
			this.TimeLabel.Name = "TimeLabel";
			this.TimeLabel.Size = new System.Drawing.Size(120, 23);
			this.TimeLabel.TabIndex = 6;
			this.TimeLabel.Text = "时间:";
			this.TimeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// DateLabel
			// 
			this.DateLabel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
			this.DateLabel.Cursor = System.Windows.Forms.Cursors.Hand;
			this.DateLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.DateLabel.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.DateLabel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.DateLabel.Location = new System.Drawing.Point(8, 360);
			this.DateLabel.Name = "DateLabel";
			this.DateLabel.Size = new System.Drawing.Size(152, 23);
			this.DateLabel.TabIndex = 7;
			this.DateLabel.Text = "日期:";
			this.DateLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// btnOpen
			// 
			this.btnOpen.Enabled = false;
			this.btnOpen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnOpen.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.btnOpen.ForeColor = System.Drawing.Color.Blue;
			this.btnOpen.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnOpen.ImageIndex = 1;
			this.btnOpen.ImageList = this.imageList;
			this.btnOpen.Location = new System.Drawing.Point(32, 224);
			this.btnOpen.Name = "btnOpen";
			this.btnOpen.Size = new System.Drawing.Size(104, 24);
			this.btnOpen.TabIndex = 8;
			this.btnOpen.Text = "打开端口(&O)";
			this.btnOpen.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnOpen.Visible = false;
			this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
			this.btnOpen.MouseEnter += new System.EventHandler(this.btnOpen_MouseEnter);
			this.btnOpen.MouseLeave += new System.EventHandler(this.btnOpen_MouseLeave);
			// 
			// imageList
			// 
			this.imageList.ImageSize = new System.Drawing.Size(16, 16);
			this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
			this.imageList.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// btnClose
			// 
			this.btnClose.Enabled = false;
			this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnClose.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.btnClose.ForeColor = System.Drawing.Color.Blue;
			this.btnClose.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnClose.ImageIndex = 3;
			this.btnClose.ImageList = this.imageList;
			this.btnClose.Location = new System.Drawing.Point(32, 280);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new System.Drawing.Size(104, 24);
			this.btnClose.TabIndex = 9;
			this.btnClose.Text = "关闭端口(&C)";
			this.btnClose.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnClose.Visible = false;
			this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
			this.btnClose.MouseEnter += new System.EventHandler(this.btnOpen_MouseEnter);
			this.btnClose.MouseLeave += new System.EventHandler(this.btnOpen_MouseLeave);
			// 
			// contextMenu
			// 
			this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						this.menuClose,
																						this.menuExitSystem});
			// 
			// menuClose
			// 
			this.menuClose.Index = 0;
			this.menuClose.Shortcut = System.Windows.Forms.Shortcut.CtrlX;
			this.menuClose.Text = "关闭窗体但不退出系统(&C)";
			this.menuClose.Click += new System.EventHandler(this.menuClose_Click);
			// 

⌨️ 快捷键说明

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