📄 leave.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Reflection;
namespace ManPowerManage.UILevel
{
/// <summary>
/// Leave 的摘要说明。
/// </summary>
public class Leave : System.Windows.Forms.Form
{
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox textRemark;
private System.Windows.Forms.TextBox textEmployeeID;
private System.Windows.Forms.DateTimePicker dateTimePicker2;
private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox comboLeaveType;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.DataGrid dataGrid2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.DateTimePicker dateTimePicker3;
private System.Windows.Forms.DateTimePicker dateTimePicker4;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button btnExcel;
private OleDbConnection Connection1=null;
private OleDbCommand Command1=null;
private OleDbDataReader DataReader1=null;
private OleDbDataAdapter dataAdapter1=null;
private OleDbDataAdapter dataAdapter2=null;
DataView DataViewLeave=new DataView();
private DataSet DataSetLeaveRecord=new DataSet();
private DataSet DataSetView_LeaveRecord=new DataSet();
private string commandStr;
private string connectionStr;
private string selectStr1;
private string selectStr2;
private string [] myData={"职工号","姓名","部门","类型","开始日期","结束日期","请假天数","日期","备注"};
private System.Windows.Forms.TextBox textDays;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.ComboBox comboLeaveType2;
private System.Windows.Forms.Label lblRecord;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn1;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn2;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn3;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn4;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn5;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn6;
private System.Windows.Forms.Button btnSearch;
private System.Windows.Forms.TextBox textEmployeeID2;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle2;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn7;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn8;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn9;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn10;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn11;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn12;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn13;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn14;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn15;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.Button btnModify;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnApply;
private System.Windows.Forms.Button btnCancelSearch;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Leave()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.connectionStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +Application.StartupPath + "\\ManPowerManage.mdb";
this.selectStr2="select * from View_LeaveRecord";
this.selectStr1="select * from LeaveRecord";
this.Connection1=new OleDbConnection(this.connectionStr);
this.Command1=new OleDbCommand();
this.dataAdapter1=new OleDbDataAdapter(this.selectStr1,this.Connection1);
this.dataAdapter2=new OleDbDataAdapter(this.selectStr2,this.Connection1);
this.Command1.Connection=this.Connection1;
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Leave));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnAdd = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.btnModify = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnApply = new System.Windows.Forms.Button();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn2 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn3 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn4 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn5 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn6 = new System.Windows.Forms.DataGridTextBoxColumn();
this.button5 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.lblRecord = new System.Windows.Forms.Label();
this.button7 = new System.Windows.Forms.Button();
this.button8 = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.label12 = new System.Windows.Forms.Label();
this.textDays = new System.Windows.Forms.TextBox();
this.textRemark = new System.Windows.Forms.TextBox();
this.textEmployeeID = new System.Windows.Forms.TextBox();
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.label5 = new System.Windows.Forms.Label();
this.comboLeaveType = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.btnSearch = new System.Windows.Forms.Button();
this.btnExcel = new System.Windows.Forms.Button();
this.btnCancelSearch = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.textEmployeeID2 = new System.Windows.Forms.TextBox();
this.dateTimePicker3 = new System.Windows.Forms.DateTimePicker();
this.dateTimePicker4 = new System.Windows.Forms.DateTimePicker();
this.comboLeaveType2 = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.dataGrid2 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle2 = new System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn12 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn7 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn8 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn14 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn9 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn10 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn11 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn13 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn15 = new System.Windows.Forms.DataGridTextBoxColumn();
this.btnExit = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.groupBox3.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).BeginInit();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(24, 8);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(712, 536);
this.tabControl1.TabIndex = 0;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.dataGrid1);
this.tabPage1.Controls.Add(this.button5);
this.tabPage1.Controls.Add(this.button6);
this.tabPage1.Controls.Add(this.lblRecord);
this.tabPage1.Controls.Add(this.button7);
this.tabPage1.Controls.Add(this.button8);
this.tabPage1.Controls.Add(this.groupBox3);
this.tabPage1.Location = new System.Drawing.Point(4, 21);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(704, 511);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "添加事假病假";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.btnAdd);
this.groupBox2.Controls.Add(this.btnDelete);
this.groupBox2.Controls.Add(this.btnModify);
this.groupBox2.Controls.Add(this.btnCancel);
this.groupBox2.Controls.Add(this.btnApply);
this.groupBox2.Location = new System.Drawing.Point(568, 24);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(88, 472);
this.groupBox2.TabIndex = 135;
this.groupBox2.TabStop = false;
//
// btnAdd
//
this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAdd.Image = ((System.Drawing.Image)(resources.GetObject("btnAdd.Image")));
this.btnAdd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnAdd.Location = new System.Drawing.Point(16, 48);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(56, 24);
this.btnAdd.TabIndex = 109;
this.btnAdd.Text = "添加";
this.btnAdd.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnDelete
//
this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image")));
this.btnDelete.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnDelete.Location = new System.Drawing.Point(16, 80);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(56, 24);
this.btnDelete.TabIndex = 132;
this.btnDelete.Text = "删除";
this.btnDelete.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnModify
//
this.btnModify.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnModify.Image = ((System.Drawing.Image)(resources.GetObject("btnModify.Image")));
this.btnModify.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnModify.Location = new System.Drawing.Point(16, 120);
this.btnModify.Name = "btnModify";
this.btnModify.Size = new System.Drawing.Size(56, 24);
this.btnModify.TabIndex = 133;
this.btnModify.Text = "修改";
this.btnModify.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnModify.Click += new System.EventHandler(this.btnModify_Click);
//
// btnCancel
//
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Image = ((System.Drawing.Image)(resources.GetObject("btnCancel.Image")));
this.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnCancel.Location = new System.Drawing.Point(16, 320);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(56, 24);
this.btnCancel.TabIndex = 130;
this.btnCancel.Text = "取消";
this.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnApply
//
this.btnApply.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnApply.Image = ((System.Drawing.Image)(resources.GetObject("btnApply.Image")));
this.btnApply.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnApply.Location = new System.Drawing.Point(16, 360);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(56, 24);
this.btnApply.TabIndex = 131;
this.btnApply.Text = "保存";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -