searchbrushframehistory.cs
来自「独立完成考勤管理软件加打卡系统(C#) 是打卡加管理系统软件 」· CS 代码 · 共 528 行 · 第 1/2 页
CS
528 行
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using WindowsApplication.searchBrushFrameHistory;
namespace WindowsApplication
{
/// <summary>
/// SearchBrushFrameHistory 的摘要说明。
/// </summary>
public class SearchBrushFrameHistory : System.Windows.Forms.Form
{
#region 控件集合...
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ToolBar tool;
private System.Windows.Forms.ToolBarButton tFirst;
private System.Windows.Forms.ToolBarButton tLast;
private System.Windows.Forms.ToolBarButton tNext;
private System.Windows.Forms.ToolBarButton tEnd;
private System.Windows.Forms.ToolBarButton tSearch;
private System.Windows.Forms.ToolBarButton tDelete;
private System.Windows.Forms.ToolBarButton tExit;
private System.Windows.Forms.ContextMenu contextMenu;
private System.Windows.Forms.ImageList image;
private System.Windows.Forms.StatusBar brushStatus;
private System.Windows.Forms.StatusBarPanel brushID;
private System.Windows.Forms.StatusBarPanel brushDate;
private System.Windows.Forms.StatusBarPanel brushTime;
private System.Windows.Forms.StatusBarPanel brushUser;
private System.Windows.Forms.StatusBarPanel brushStauts;
private System.Windows.Forms.MenuItem menuDateTime;
private System.Windows.Forms.MenuItem menuName;
private System.Windows.Forms.Timer currentTimer;
private System.Windows.Forms.DataGrid dataGrid;
private System.ComponentModel.IContainer components;
#endregion
#region 数据库变量...
private ConnectionData conn=new ConnectionData();
private DataTable tempTable=new DataTable();
private System.Windows.Forms.CurrencyManager cmOrders=null;
#endregion
#region 变量定义...
private string searchSql="select * from Emp_Time";
#endregion
#region 构造函数...
public SearchBrushFrameHistory()
{
//
// 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(SearchBrushFrameHistory));
this.label1 = new System.Windows.Forms.Label();
this.tool = new System.Windows.Forms.ToolBar();
this.tFirst = new System.Windows.Forms.ToolBarButton();
this.tLast = new System.Windows.Forms.ToolBarButton();
this.tNext = new System.Windows.Forms.ToolBarButton();
this.tEnd = new System.Windows.Forms.ToolBarButton();
this.tSearch = new System.Windows.Forms.ToolBarButton();
this.contextMenu = new System.Windows.Forms.ContextMenu();
this.menuDateTime = new System.Windows.Forms.MenuItem();
this.menuName = new System.Windows.Forms.MenuItem();
this.tDelete = new System.Windows.Forms.ToolBarButton();
this.tExit = new System.Windows.Forms.ToolBarButton();
this.image = new System.Windows.Forms.ImageList(this.components);
this.dataGrid = new System.Windows.Forms.DataGrid();
this.brushStatus = new System.Windows.Forms.StatusBar();
this.brushID = new System.Windows.Forms.StatusBarPanel();
this.brushDate = new System.Windows.Forms.StatusBarPanel();
this.brushTime = new System.Windows.Forms.StatusBarPanel();
this.brushUser = new System.Windows.Forms.StatusBarPanel();
this.brushStauts = new System.Windows.Forms.StatusBarPanel();
this.currentTimer = new System.Windows.Forms.Timer(this.components);
((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.brushID)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.brushDate)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.brushTime)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.brushUser)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.brushStauts)).BeginInit();
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, 48);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(778, 40);
this.label1.TabIndex = 0;
this.label1.Text = "刷卡管理";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tool
//
this.tool.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
this.tool.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.tFirst,
this.tLast,
this.tNext,
this.tEnd,
this.tSearch,
this.tDelete,
this.tExit});
this.tool.DropDownArrows = true;
this.tool.ImageList = this.image;
this.tool.Location = new System.Drawing.Point(0, 0);
this.tool.Name = "tool";
this.tool.ShowToolTips = true;
this.tool.Size = new System.Drawing.Size(778, 41);
this.tool.TabIndex = 1;
this.tool.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tool_ButtonClick);
//
// tFirst
//
this.tFirst.ImageIndex = 0;
this.tFirst.Text = "首记录";
//
// tLast
//
this.tLast.ImageIndex = 1;
this.tLast.Text = "上一条记录";
//
// tNext
//
this.tNext.ImageIndex = 2;
this.tNext.Text = "下一条记录";
//
// tEnd
//
this.tEnd.ImageIndex = 3;
this.tEnd.Text = "尾记录";
//
// tSearch
//
this.tSearch.DropDownMenu = this.contextMenu;
this.tSearch.ImageIndex = 4;
this.tSearch.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
this.tSearch.Text = "查询";
//
// contextMenu
//
this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuDateTime,
this.menuName});
//
// menuDateTime
//
this.menuDateTime.Index = 0;
this.menuDateTime.Text = "日期时间(&D)";
this.menuDateTime.Click += new System.EventHandler(this.menuDateTime_Click);
//
// menuName
//
this.menuName.Index = 1;
this.menuName.Text = "姓名查询(&N)";
this.menuName.Click += new System.EventHandler(this.menuName_Click);
//
// tDelete
//
this.tDelete.ImageIndex = 6;
this.tDelete.Text = "清除历史记录";
//
// tExit
//
this.tExit.ImageIndex = 5;
this.tExit.Text = "退出";
//
// image
//
this.image.ImageSize = new System.Drawing.Size(16, 16);
this.image.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("image.ImageStream")));
this.image.TransparentColor = System.Drawing.Color.Transparent;
//
// dataGrid
//
this.dataGrid.AlternatingBackColor = System.Drawing.Color.GhostWhite;
this.dataGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.dataGrid.BackColor = System.Drawing.Color.GhostWhite;
this.dataGrid.BackgroundColor = System.Drawing.Color.Lavender;
this.dataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.dataGrid.CaptionBackColor = System.Drawing.Color.RoyalBlue;
this.dataGrid.CaptionForeColor = System.Drawing.Color.White;
this.dataGrid.CaptionVisible = false;
this.dataGrid.DataMember = "";
this.dataGrid.FlatMode = true;
this.dataGrid.Font = new System.Drawing.Font("Tahoma", 8F);
this.dataGrid.ForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid.GridLineColor = System.Drawing.Color.RoyalBlue;
this.dataGrid.HeaderBackColor = System.Drawing.Color.MidnightBlue;
this.dataGrid.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid.HeaderForeColor = System.Drawing.Color.Lavender;
this.dataGrid.LinkColor = System.Drawing.Color.Teal;
this.dataGrid.Location = new System.Drawing.Point(0, 88);
this.dataGrid.Name = "dataGrid";
this.dataGrid.ParentRowsBackColor = System.Drawing.Color.Lavender;
this.dataGrid.ParentRowsForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid.ReadOnly = true;
this.dataGrid.SelectionBackColor = System.Drawing.Color.Teal;
this.dataGrid.SelectionForeColor = System.Drawing.Color.PaleGreen;
this.dataGrid.Size = new System.Drawing.Size(784, 328);
this.dataGrid.TabIndex = 2;
//
// brushStatus
//
this.brushStatus.Location = new System.Drawing.Point(0, 415);
this.brushStatus.Name = "brushStatus";
this.brushStatus.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.brushID,
this.brushDate,
this.brushTime,
this.brushUser,
this.brushStauts});
this.brushStatus.ShowPanels = true;
this.brushStatus.Size = new System.Drawing.Size(778, 32);
this.brushStatus.TabIndex = 3;
this.brushStatus.Text = "statusBar1";
//
// brushID
//
this.brushID.Icon = ((System.Drawing.Icon)(resources.GetObject("brushID.Icon")));
this.brushID.Text = "记录:";
this.brushID.Width = 150;
//
// brushDate
//
this.brushDate.Icon = ((System.Drawing.Icon)(resources.GetObject("brushDate.Icon")));
this.brushDate.Text = "日期:";
this.brushDate.Width = 150;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?