📄 员工考勤.cs
字号:
#region Named Place....
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using WindowsApplication.BrushKaID;
#endregion
namespace WindowsApplication
{
public class 员工考勤 : System.Windows.Forms.Form
{
#region 数据库变量...
private SqlConnection con=new SqlConnection();
private string connectionStr="Workstation id=localhost;Integrated security=SSPI;DataBase=SystemODBC;";
private SqlCommand com=new SqlCommand();
private SqlDataAdapter dataAdapter=null;
private TreeNode rootNode=new TreeNode("职员如下:");
#endregion
#region 控件声明 ....
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.StatusBar kaStatus;
private System.Windows.Forms.StatusBarPanel kaoqinyuan;
private System.Windows.Forms.StatusBarPanel kaoqinriqi;
private System.Windows.Forms.StatusBarPanel kaoqinshijian;
private System.Windows.Forms.StatusBarPanel kaoqinzhuangtai;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DataGrid dataGrid;
private System.Windows.Forms.Timer timerStart;
private System.Windows.Forms.Timer currentTimer;
private System.Windows.Forms.ToolBar tool;
private System.Windows.Forms.ToolBarButton toolTimeDesign;
private System.Windows.Forms.ToolBarButton toolShuaKa;
private System.Windows.Forms.ToolBarButton toolTongJi;
private System.Windows.Forms.ImageList image;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.ToolBarButton toolTime;
private System.Windows.Forms.ToolBarButton toolBarButton3;
private System.Windows.Forms.Button btnsearchSou;
private System.Windows.Forms.ContextMenu contextMenu;
private System.Windows.Forms.MenuItem menuReason;
private System.Windows.Forms.MenuItem menuBrush;
private System.Windows.Forms.ComboBox EmployeeCombox;
private System.Windows.Forms.StatusBarPanel kaoqintongji;
private System.Windows.Forms.TreeView employeeNameTree;
private System.Windows.Forms.ComboBox emp_Name;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter;
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 System.Data.SqlClient.SqlConnection sqlConnection;
private WindowsApplication.Emp_BrushFrameIDSet emp_BrushFrameIDSet;
private System.Data.SqlClient.SqlDataAdapter searchKaoQinManager;
private System.Data.SqlClient.SqlConnection sqlConn;
private System.Data.SqlClient.SqlCommand sqlSelectCommand2;
private System.Windows.Forms.ComboBox dateTimePicker1;
private System.ComponentModel.IContainer components;
#endregion
#region 构造函数
public 员工考勤()
{
//
// 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(员工考勤));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.dateTimePicker1 = new System.Windows.Forms.ComboBox();
this.emp_Name = new System.Windows.Forms.ComboBox();
this.btnsearchSou = new System.Windows.Forms.Button();
this.employeeNameTree = new System.Windows.Forms.TreeView();
this.image = new System.Windows.Forms.ImageList(this.components);
this.EmployeeCombox = new System.Windows.Forms.ComboBox();
this.dataGrid = new System.Windows.Forms.DataGrid();
this.kaStatus = new System.Windows.Forms.StatusBar();
this.kaoqinyuan = new System.Windows.Forms.StatusBarPanel();
this.kaoqinriqi = new System.Windows.Forms.StatusBarPanel();
this.kaoqinshijian = new System.Windows.Forms.StatusBarPanel();
this.kaoqintongji = new System.Windows.Forms.StatusBarPanel();
this.kaoqinzhuangtai = new System.Windows.Forms.StatusBarPanel();
this.timerStart = new System.Windows.Forms.Timer(this.components);
this.currentTimer = new System.Windows.Forms.Timer(this.components);
this.tool = new System.Windows.Forms.ToolBar();
this.toolTimeDesign = new System.Windows.Forms.ToolBarButton();
this.contextMenu = new System.Windows.Forms.ContextMenu();
this.menuReason = new System.Windows.Forms.MenuItem();
this.menuBrush = new System.Windows.Forms.MenuItem();
this.toolShuaKa = new System.Windows.Forms.ToolBarButton();
this.toolTongJi = new System.Windows.Forms.ToolBarButton();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolTime = new System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
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.emp_BrushFrameIDSet = new WindowsApplication.Emp_BrushFrameIDSet();
this.searchKaoQinManager = new System.Data.SqlClient.SqlDataAdapter();
this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlConn = new System.Data.SqlClient.SqlConnection();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kaoqinyuan)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kaoqinriqi)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kaoqinshijian)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kaoqintongji)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kaoqinzhuangtai)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.emp_BrushFrameIDSet)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Cursor = System.Windows.Forms.Cursors.Hand;
this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(866, 40);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// 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)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.label1.Location = new System.Drawing.Point(0, -16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(878, 64);
this.label1.TabIndex = 0;
this.label1.Text = "考勤管理";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// groupBox2
//
this.groupBox2.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.groupBox2.Controls.Add(this.dateTimePicker1);
this.groupBox2.Controls.Add(this.emp_Name);
this.groupBox2.Controls.Add(this.btnsearchSou);
this.groupBox2.Controls.Add(this.employeeNameTree);
this.groupBox2.Controls.Add(this.EmployeeCombox);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.dataGrid);
this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.groupBox2.Location = new System.Drawing.Point(0, 48);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(872, 408);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(152, 376);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(121, 20);
this.dateTimePicker1.TabIndex = 9;
this.dateTimePicker1.MouseEnter += new System.EventHandler(this.dateTimePicker1_MouseEnter);
this.dateTimePicker1.MouseLeave += new System.EventHandler(this.dateTimePicker1_MouseLeave);
//
// emp_Name
//
this.emp_Name.Cursor = System.Windows.Forms.Cursors.Hand;
this.emp_Name.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
this.emp_Name.Location = new System.Drawing.Point(296, 376);
this.emp_Name.Name = "emp_Name";
this.emp_Name.Size = new System.Drawing.Size(112, 20);
this.emp_Name.TabIndex = 8;
this.emp_Name.MouseEnter += new System.EventHandler(this.emp_Name_MouseEnter);
this.emp_Name.MouseLeave += new System.EventHandler(this.emp_Name_MouseLeave);
//
// btnsearchSou
//
this.btnsearchSou.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.btnsearchSou.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnsearchSou.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnsearchSou.ForeColor = System.Drawing.Color.Black;
this.btnsearchSou.Location = new System.Drawing.Point(424, 376);
this.btnsearchSou.Name = "btnsearchSou";
this.btnsearchSou.Size = new System.Drawing.Size(75, 24);
this.btnsearchSou.TabIndex = 7;
this.btnsearchSou.Text = "查询(&T)";
this.btnsearchSou.Click += new System.EventHandler(this.btnsearchSou_Click);
this.btnsearchSou.MouseEnter += new System.EventHandler(this.btnSearch_MouseEnter);
this.btnsearchSou.MouseLeave += new System.EventHandler(this.btnSearch_MouseLeave);
//
// employeeNameTree
//
this.employeeNameTree.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.employeeNameTree.Cursor = System.Windows.Forms.Cursors.Hand;
this.employeeNameTree.ImageIndex = 1;
this.employeeNameTree.ImageList = this.image;
this.employeeNameTree.Location = new System.Drawing.Point(0, 48);
this.employeeNameTree.Name = "employeeNameTree";
this.employeeNameTree.Size = new System.Drawing.Size(136, 360);
this.employeeNameTree.Sorted = true;
this.employeeNameTree.TabIndex = 2;
this.employeeNameTree.AfterExpand += new System.Windows.Forms.TreeViewEventHandler(this.employeeNameTree_AfterExpand);
this.employeeNameTree.AfterCollapse += new System.Windows.Forms.TreeViewEventHandler(this.employeeNameTree_AfterCollapse);
this.employeeNameTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.departmentTree_AfterSelect);
//
// 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;
//
// EmployeeCombox
//
this.EmployeeCombox.Cursor = System.Windows.Forms.Cursors.Hand;
this.EmployeeCombox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
this.EmployeeCombox.Location = new System.Drawing.Point(0, 16);
this.EmployeeCombox.Name = "EmployeeCombox";
this.EmployeeCombox.Size = new System.Drawing.Size(136, 20);
this.EmployeeCombox.Sorted = true;
this.EmployeeCombox.TabIndex = 1;
this.EmployeeCombox.SelectedIndexChanged += new System.EventHandler(this.departmentCombox_SelectedIndexChanged);
this.EmployeeCombox.MouseEnter += new System.EventHandler(this.EmployeeCombox_MouseEnter);
this.EmployeeCombox.MouseLeave += new System.EventHandler(this.EmployeeCombox_MouseLeave);
//
// dataGrid
//
this.dataGrid.AlternatingBackColor = System.Drawing.Color.GhostWhite;
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(136, 48);
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(792, 320);
this.dataGrid.TabIndex = 0;
this.dataGrid.CurrentCellChanged += new System.EventHandler(this.dataGrid_CurrentCellChanged);
//
// kaStatus
//
this.kaStatus.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -