📄 monthframe.cs
字号:
#region 命名空间...
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data;
#endregion
namespace WindowsApplication
{
#region Class MonthFrame 类...
public class MonthFrame : System.Windows.Forms.Form
{
#region 控件...
private System.Windows.Forms.Label titleLabel;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.DataGrid dataGrid;
private System.Windows.Forms.StatusBar statusBar;
private System.Windows.Forms.StatusBarPanel stStatus;
private System.Windows.Forms.StatusBarPanel stTime;
private System.Windows.Forms.StatusBarPanel stDate;
private System.Windows.Forms.StatusBarPanel stuser;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox MonthText;
private System.Windows.Forms.ComboBox department;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button btnStatictis;
private System.Windows.Forms.Button btnPrint;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.RadioButton textFileA;
private System.Windows.Forms.RadioButton textFileB;
private System.Windows.Forms.RadioButton textAll;
private System.Windows.Forms.ImageList imageList;
private System.Windows.Forms.ComboBox emp_Text;
private ConnectionData conn=new ConnectionData();
private System.Windows.Forms.Timer currentTime;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter;
private WindowsApplication.MonthdataTable monthdataTable;
private System.ComponentModel.IContainer components;
#endregion
#region 构造函数...
public MonthFrame()
{
//
// 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(MonthFrame));
this.titleLabel = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textAll = new System.Windows.Forms.RadioButton();
this.textFileB = new System.Windows.Forms.RadioButton();
this.textFileA = new System.Windows.Forms.RadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.emp_Text = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.department = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.MonthText = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.btnStatictis = new System.Windows.Forms.Button();
this.imageList = new System.Windows.Forms.ImageList(this.components);
this.btnPrint = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.dataGrid = new System.Windows.Forms.DataGrid();
this.statusBar = new System.Windows.Forms.StatusBar();
this.stStatus = new System.Windows.Forms.StatusBarPanel();
this.stTime = new System.Windows.Forms.StatusBarPanel();
this.stDate = new System.Windows.Forms.StatusBarPanel();
this.stuser = new System.Windows.Forms.StatusBarPanel();
this.currentTime = new System.Windows.Forms.Timer(this.components);
this.sqlDataAdapter = new System.Data.SqlClient.SqlDataAdapter();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.monthdataTable = new WindowsApplication.MonthdataTable();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.stStatus)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.stTime)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.stDate)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.stuser)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.monthdataTable)).BeginInit();
this.SuspendLayout();
//
// titleLabel
//
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(664, 40);
this.titleLabel.TabIndex = 0;
this.titleLabel.Text = "月考勤统计";
this.titleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textAll);
this.groupBox1.Controls.Add(this.textFileB);
this.groupBox1.Controls.Add(this.textFileA);
this.groupBox1.Location = new System.Drawing.Point(16, 48);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(272, 120);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
//
// textAll
//
this.textAll.Cursor = System.Windows.Forms.Cursors.Hand;
this.textAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.textAll.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.textAll.Location = new System.Drawing.Point(32, 88);
this.textAll.Name = "textAll";
this.textAll.Size = new System.Drawing.Size(200, 24);
this.textAll.TabIndex = 2;
this.textAll.Text = "全部(包括以上两项)";
//
// textFileB
//
this.textFileB.Cursor = System.Windows.Forms.Cursors.Hand;
this.textFileB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.textFileB.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.textFileB.Location = new System.Drawing.Point(32, 56);
this.textFileB.Name = "textFileB";
this.textFileB.Size = new System.Drawing.Size(200, 24);
this.textFileB.TabIndex = 1;
this.textFileB.Text = "正常考勤";
//
// textFileA
//
this.textFileA.Checked = true;
this.textFileA.Cursor = System.Windows.Forms.Cursors.Hand;
this.textFileA.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.textFileA.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.textFileA.Location = new System.Drawing.Point(32, 24);
this.textFileA.Name = "textFileA";
this.textFileA.Size = new System.Drawing.Size(208, 24);
this.textFileA.TabIndex = 0;
this.textFileA.TabStop = true;
this.textFileA.Text = "非正常考勤(包括请假,迟到等等)";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.emp_Text);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.department);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.MonthText);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Location = new System.Drawing.Point(304, 48);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(232, 120);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
//
// emp_Text
//
this.emp_Text.Cursor = System.Windows.Forms.Cursors.Hand;
this.emp_Text.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
this.emp_Text.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.emp_Text.Location = new System.Drawing.Point(80, 88);
this.emp_Text.Name = "emp_Text";
this.emp_Text.Size = new System.Drawing.Size(136, 20);
this.emp_Text.Sorted = true;
this.emp_Text.TabIndex = 5;
this.emp_Text.MouseEnter += new System.EventHandler(this.emp_Text_MouseEnter);
this.emp_Text.MouseLeave += new System.EventHandler(this.emp_Text_MouseLeave);
//
// label3
//
this.label3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label3.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.label3.Location = new System.Drawing.Point(8, 88);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(72, 23);
this.label3.TabIndex = 4;
this.label3.Text = "员工:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// department
//
this.department.Cursor = System.Windows.Forms.Cursors.Hand;
this.department.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
this.department.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.department.Location = new System.Drawing.Point(80, 56);
this.department.Name = "department";
this.department.Size = new System.Drawing.Size(136, 20);
this.department.TabIndex = 3;
this.department.Text = "所有部门";
this.department.MouseEnter += new System.EventHandler(this.department_MouseEnter);
this.department.MouseLeave += new System.EventHandler(this.department_MouseLeave);
//
// label2
//
this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label2.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.label2.Location = new System.Drawing.Point(8, 56);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 23);
this.label2.TabIndex = 2;
this.label2.Text = "部门:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// MonthText
//
this.MonthText.Cursor = System.Windows.Forms.Cursors.Hand;
this.MonthText.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
this.MonthText.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.MonthText.Items.AddRange(new object[] {
"01月",
"02月",
"03月",
"04月",
"05月",
"06月",
"07月",
"08月",
"09月",
"10月",
"11月",
"12月"});
this.MonthText.Location = new System.Drawing.Point(80, 24);
this.MonthText.Name = "MonthText";
this.MonthText.Size = new System.Drawing.Size(136, 20);
this.MonthText.TabIndex = 1;
this.MonthText.SelectedIndexChanged += new System.EventHandler(this.MonthText_SelectedIndexChanged);
this.MonthText.MouseEnter += new System.EventHandler(this.department_MouseEnter);
this.MonthText.MouseLeave += new System.EventHandler(this.department_MouseLeave);
//
// label1
//
this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.label1.Location = new System.Drawing.Point(8, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 23);
this.label1.TabIndex = 0;
this.label1.Text = "月份:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnStatictis
//
this.btnStatictis.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnStatictis.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStatictis.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnStatictis.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.btnStatictis.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnStatictis.ImageIndex = 0;
this.btnStatictis.ImageList = this.imageList;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -