?? reward.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>
/// Reward 的摘要說明。
/// </summary>
public class Reward : System.Windows.Forms.Form
{
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Button btnModify;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textRemark;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.ComboBox comboRewardType;
private System.Windows.Forms.TextBox textEmployeeID;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Button btnApply;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnLast;
private System.Windows.Forms.Button btnFirst;
private System.Windows.Forms.Label lblRecord;
private System.Windows.Forms.Button btnPrevious;
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.DateTimePicker dateTimePicker3;
private System.Windows.Forms.DateTimePicker dateTimePicker4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox comboRewardType2;
private System.Windows.Forms.TextBox textEmployeeID2;
private System.Windows.Forms.Button btnRewardCancel;
private System.Windows.Forms.Button btnRewardSearch;
private System.Windows.Forms.Button btnRewardExport;
private System.Windows.Forms.DataGrid dataGrid2;
private string connectionStr;
private string selectStr;
private string commandStr;
private OleDbConnection Connection1=null;
private OleDbCommand Command1=null;
private OleDbDataReader DataReader1=null;
private OleDbDataAdapter dataAdapter1=null;
private OleDbDataAdapter dataAdapter2=null;
private DataSet DataSetReward=new DataSet();
private DataSet DataSetViewReward=new DataSet();
private bool add=false;
DataView DataViewReward=new DataView();
private string [] ListHeader={"職工號","姓名","部門","類型","數(shù)額/元","日期"};
/// <summary>
/// 必需的設(shè)計器變量。
/// </summary>
private System.ComponentModel.Container components = null;
public Reward()
{
//
// Windows 窗體設(shè)計器支持所必需的
//
InitializeComponent();
this.connectionStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +Application.StartupPath + "\\ManPowerManage.mdb";
this.selectStr="select * from Reward";
this.Connection1=new OleDbConnection(this.connectionStr);
this.Command1=new OleDbCommand();
this.dataAdapter1=new OleDbDataAdapter(this.selectStr,this.Connection1);
this.selectStr="select * from View_Reward";
this.dataAdapter2=new OleDbDataAdapter(this.selectStr,this.Connection1);
this.Command1.Connection=this.Connection1;
//
// TODO: 在 InitializeComponent 調(diào)用后添加任何構(gòu)造函數(shù)代碼
//
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗體設(shè)計器生成的代碼
/// <summary>
/// 設(shè)計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Reward));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.btnModify = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.btnAdd = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.textRemark = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.label10 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.comboRewardType = new System.Windows.Forms.ComboBox();
this.textEmployeeID = new System.Windows.Forms.TextBox();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.btnApply = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnLast = new System.Windows.Forms.Button();
this.btnFirst = new System.Windows.Forms.Button();
this.lblRecord = new System.Windows.Forms.Label();
this.btnPrevious = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.dateTimePicker3 = new System.Windows.Forms.DateTimePicker();
this.dateTimePicker4 = new System.Windows.Forms.DateTimePicker();
this.label3 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.comboRewardType2 = new System.Windows.Forms.ComboBox();
this.textEmployeeID2 = new System.Windows.Forms.TextBox();
this.btnRewardCancel = new System.Windows.Forms.Button();
this.btnRewardSearch = new System.Windows.Forms.Button();
this.btnRewardExport = new System.Windows.Forms.Button();
this.dataGrid2 = new System.Windows.Forms.DataGrid();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
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(16, 16);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(616, 464);
this.tabControl1.TabIndex = 2;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.btnModify);
this.tabPage1.Controls.Add(this.btnDelete);
this.tabPage1.Controls.Add(this.btnAdd);
this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.dataGrid1);
this.tabPage1.Controls.Add(this.btnApply);
this.tabPage1.Controls.Add(this.btnCancel);
this.tabPage1.Controls.Add(this.btnLast);
this.tabPage1.Controls.Add(this.btnFirst);
this.tabPage1.Controls.Add(this.lblRecord);
this.tabPage1.Controls.Add(this.btnPrevious);
this.tabPage1.Controls.Add(this.btnNext);
this.tabPage1.Location = new System.Drawing.Point(4, 21);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(608, 439);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "獎懲記錄管理";
//
// 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(504, 120);
this.btnModify.Name = "btnModify";
this.btnModify.Size = new System.Drawing.Size(56, 24);
this.btnModify.TabIndex = 109;
this.btnModify.Text = "修改";
this.btnModify.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnModify.Click += new System.EventHandler(this.btnModify_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(504, 88);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(56, 24);
this.btnDelete.TabIndex = 108;
this.btnDelete.Text = "刪除";
this.btnDelete.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// 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(504, 56);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(56, 24);
this.btnAdd.TabIndex = 107;
this.btnAdd.Text = "添加";
this.btnAdd.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.textRemark);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.dateTimePicker1);
this.groupBox2.Controls.Add(this.label10);
this.groupBox2.Controls.Add(this.label12);
this.groupBox2.Controls.Add(this.comboRewardType);
this.groupBox2.Controls.Add(this.textEmployeeID);
this.groupBox2.Location = new System.Drawing.Point(8, 16);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(432, 104);
this.groupBox2.TabIndex = 37;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "獎懲記錄";
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 64);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 23);
this.label2.TabIndex = 100;
this.label2.Text = "備注";
//
// textRemark
//
this.textRemark.Location = new System.Drawing.Point(56, 64);
this.textRemark.Name = "textRemark";
this.textRemark.Size = new System.Drawing.Size(360, 21);
this.textRemark.TabIndex = 99;
this.textRemark.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(264, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(40, 23);
this.label1.TabIndex = 98;
this.label1.Text = "日期";
//
// dateTimePicker1
//
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dateTimePicker1.Location = new System.Drawing.Point(312, 24);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(104, 21);
this.dateTimePicker1.TabIndex = 97;
this.dateTimePicker1.Value = new System.DateTime(2003, 12, 20, 0, 0, 0, 0);
//
// label10
//
this.label10.Location = new System.Drawing.Point(8, 32);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(48, 23);
this.label10.TabIndex = 28;
this.label10.Text = "職工號";
//
// label12
//
this.label12.Location = new System.Drawing.Point(120, 24);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(56, 23);
this.label12.TabIndex = 34;
this.label12.Text = "獎懲類型";
//
// comboRewardType
//
this.comboRewardType.ItemHeight = 12;
this.comboRewardType.Location = new System.Drawing.Point(176, 24);
this.comboRewardType.Name = "comboRewardType";
this.comboRewardType.Size = new System.Drawing.Size(80, 20);
this.comboRewardType.TabIndex = 35;
//
// textEmployeeID
//
this.textEmployeeID.Location = new System.Drawing.Point(56, 24);
this.textEmployeeID.Name = "textEmployeeID";
this.textEmployeeID.Size = new System.Drawing.Size(56, 21);
this.textEmployeeID.TabIndex = 29;
this.textEmployeeID.Text = "";
//
// dataGrid1
//
this.dataGrid1.AlternatingBackColor = System.Drawing.Color.GhostWhite;
this.dataGrid1.BackColor = System.Drawing.Color.GhostWhite;
this.dataGrid1.BackgroundColor = System.Drawing.Color.Lavender;
this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dataGrid1.CaptionBackColor = System.Drawing.Color.RoyalBlue;
this.dataGrid1.CaptionForeColor = System.Drawing.Color.White;
this.dataGrid1.DataMember = "";
this.dataGrid1.FlatMode = true;
this.dataGrid1.Font = new System.Drawing.Font("Tahoma", 8F);
this.dataGrid1.ForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.GridLineColor = System.Drawing.Color.RoyalBlue;
this.dataGrid1.HeaderBackColor = System.Drawing.Color.MidnightBlue;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -