📄 frmworkere.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data .SqlClient ;
namespace WindowsApplication1
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class frmworkerE : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lblfind1;
private System.Windows.Forms.Label lblfind2;
private System.Windows.Forms.ComboBox cbofind1;
private System.Windows.Forms.Button btnEbter;
private System.Windows.Forms.Button btnRu;
private System.Windows.Forms.TextBox txtfind1;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.GroupBox grpfind;
private System.Windows.Forms.DataGrid dbgworker;
private System.Windows.Forms.Button btnExit;
private SqlDataAdapter objSqlDataAdapter;
private SqlConnection objSqlConnection;
private SqlParameter objParam;
private SqlCommand objSqlCommand;
private SqlDataReader objSqlDataReader;
private DataSet objDataSet;
private DialogResult objDialogResult;
private System.Windows.Forms.Button btnPrint;
private System.Windows.Forms.Button btnPrintprv;
private System.Windows.Forms.PrintPreviewDialog ppdlgworker;
private System.Drawing.Printing.PrintDocument pdocworker;
private System.Windows.Forms.PrintDialog printworker;
private System.Windows.Forms.PageSetupDialog pageSetupDialog1;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Button btn;
private System.Windows.Forms.Button btnRe;
private System.Windows.Forms.Button btnaddwo;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Label lblDID;
private System.Windows.Forms.TextBox txtDID;
private System.Windows.Forms.Button btnDel1;
private System.Windows.Forms.Button btnDEit;
private System.Windows.Forms.TextBox txteprizc;
private System.Windows.Forms.Label lblEprizc;
private System.Windows.Forms.TextBox txtEarning;
private System.Windows.Forms.Label lblEarning;
private System.Windows.Forms.TextBox txtEID;
private System.Windows.Forms.Label lblEID;
private System.Windows.Forms.Label lblramark;
private System.Windows.Forms.TextBox txtremark;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public frmworkerE()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// 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(frmworkerE));
this.grpfind = new System.Windows.Forms.GroupBox();
this.btnRu = new System.Windows.Forms.Button();
this.btnEbter = new System.Windows.Forms.Button();
this.cbofind1 = new System.Windows.Forms.ComboBox();
this.lblfind2 = new System.Windows.Forms.Label();
this.txtfind1 = new System.Windows.Forms.TextBox();
this.lblfind1 = new System.Windows.Forms.Label();
this.dbgworker = new System.Windows.Forms.DataGrid();
this.btnAdd = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.btnPrint = new System.Windows.Forms.Button();
this.btnPrintprv = new System.Windows.Forms.Button();
this.ppdlgworker = new System.Windows.Forms.PrintPreviewDialog();
this.pdocworker = new System.Drawing.Printing.PrintDocument();
this.printworker = new System.Windows.Forms.PrintDialog();
this.pageSetupDialog1 = new System.Windows.Forms.PageSetupDialog();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.txtremark = new System.Windows.Forms.TextBox();
this.lblramark = new System.Windows.Forms.Label();
this.btn = new System.Windows.Forms.Button();
this.btnRe = new System.Windows.Forms.Button();
this.btnaddwo = new System.Windows.Forms.Button();
this.txteprizc = new System.Windows.Forms.TextBox();
this.lblEprizc = new System.Windows.Forms.Label();
this.txtEarning = new System.Windows.Forms.TextBox();
this.lblEarning = new System.Windows.Forms.Label();
this.txtEID = new System.Windows.Forms.TextBox();
this.lblEID = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.btnDEit = new System.Windows.Forms.Button();
this.btnDel1 = new System.Windows.Forms.Button();
this.txtDID = new System.Windows.Forms.TextBox();
this.lblDID = new System.Windows.Forms.Label();
this.grpfind.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dbgworker)).BeginInit();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.SuspendLayout();
//
// grpfind
//
this.grpfind.Controls.Add(this.btnRu);
this.grpfind.Controls.Add(this.btnEbter);
this.grpfind.Controls.Add(this.cbofind1);
this.grpfind.Controls.Add(this.lblfind2);
this.grpfind.Controls.Add(this.txtfind1);
this.grpfind.Controls.Add(this.lblfind1);
this.grpfind.Location = new System.Drawing.Point(8, 8);
this.grpfind.Name = "grpfind";
this.grpfind.Size = new System.Drawing.Size(600, 56);
this.grpfind.TabIndex = 0;
this.grpfind.TabStop = false;
this.grpfind.Text = "搜索";
//
// btnRu
//
this.btnRu.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnRu.Location = new System.Drawing.Point(520, 16);
this.btnRu.Name = "btnRu";
this.btnRu.Size = new System.Drawing.Size(66, 23);
this.btnRu.TabIndex = 7;
this.btnRu.Text = "还原";
this.btnRu.Click += new System.EventHandler(this.btnRu_Click);
//
// btnEbter
//
this.btnEbter.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnEbter.Location = new System.Drawing.Point(440, 16);
this.btnEbter.Name = "btnEbter";
this.btnEbter.Size = new System.Drawing.Size(66, 23);
this.btnEbter.TabIndex = 6;
this.btnEbter.Text = "确定";
this.btnEbter.Click += new System.EventHandler(this.btnEbter_Click);
//
// cbofind1
//
this.cbofind1.Items.AddRange(new object[] {
"精确搜索",
"模糊搜索"});
this.cbofind1.Location = new System.Drawing.Point(312, 16);
this.cbofind1.Name = "cbofind1";
this.cbofind1.Size = new System.Drawing.Size(112, 20);
this.cbofind1.TabIndex = 3;
this.cbofind1.Text = "精确搜索";
//
// lblfind2
//
this.lblfind2.Location = new System.Drawing.Point(224, 16);
this.lblfind2.Name = "lblfind2";
this.lblfind2.Size = new System.Drawing.Size(68, 20);
this.lblfind2.TabIndex = 2;
this.lblfind2.Text = "搜索类型:";
//
// txtfind1
//
this.txtfind1.Location = new System.Drawing.Point(112, 16);
this.txtfind1.Name = "txtfind1";
this.txtfind1.Size = new System.Drawing.Size(96, 21);
this.txtfind1.TabIndex = 1;
this.txtfind1.Text = "";
//
// lblfind1
//
this.lblfind1.Location = new System.Drawing.Point(8, 16);
this.lblfind1.Name = "lblfind1";
this.lblfind1.Size = new System.Drawing.Size(104, 20);
this.lblfind1.TabIndex = 0;
this.lblfind1.Text = "输入员工编号:";
//
// dbgworker
//
this.dbgworker.CaptionText = "员工工资详细资料";
this.dbgworker.DataMember = "";
this.dbgworker.Enabled = false;
this.dbgworker.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dbgworker.Location = new System.Drawing.Point(8, 72);
this.dbgworker.Name = "dbgworker";
this.dbgworker.Size = new System.Drawing.Size(576, 216);
this.dbgworker.TabIndex = 1;
//
// btnAdd
//
this.btnAdd.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnAdd.Location = new System.Drawing.Point(368, 296);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(97, 23);
this.btnAdd.TabIndex = 2;
this.btnAdd.Text = "修改资料";
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnExit
//
this.btnExit.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnExit.Location = new System.Drawing.Point(488, 296);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(97, 23);
this.btnExit.TabIndex = 3;
this.btnExit.Text = "退出(&E)";
this.btnExit.Click += new System.EventHandler(this.btnExid_Click);
//
// btnPrint
//
this.btnPrint.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnPrint.Location = new System.Drawing.Point(128, 296);
this.btnPrint.Name = "btnPrint";
this.btnPrint.Size = new System.Drawing.Size(97, 23);
this.btnPrint.TabIndex = 5;
this.btnPrint.Text = "打印(&P)";
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
//
// btnPrintprv
//
this.btnPrintprv.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnPrintprv.Location = new System.Drawing.Point(248, 296);
this.btnPrintprv.Name = "btnPrintprv";
this.btnPrintprv.Size = new System.Drawing.Size(97, 23);
this.btnPrintprv.TabIndex = 6;
this.btnPrintprv.Text = "打印预览";
this.btnPrintprv.Click += new System.EventHandler(this.btnPrintprv_Click);
//
// ppdlgworker
//
this.ppdlgworker.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.ppdlgworker.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.ppdlgworker.ClientSize = new System.Drawing.Size(400, 300);
this.ppdlgworker.Document = this.pdocworker;
this.ppdlgworker.Enabled = true;
this.ppdlgworker.Icon = ((System.Drawing.Icon)(resources.GetObject("ppdlgworker.Icon")));
this.ppdlgworker.Location = new System.Drawing.Point(149, 12);
this.ppdlgworker.MinimumSize = new System.Drawing.Size(375, 250);
this.ppdlgworker.Name = "ppdlgworker";
this.ppdlgworker.TransparencyKey = System.Drawing.Color.Empty;
this.ppdlgworker.Visible = false;
//
// pdocworker
//
this.pdocworker.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.pdocworker_PrintPage);
//
// printworker
//
this.printworker.Document = this.pdocworker;
//
// pageSetupDialog1
//
this.pageSetupDialog1.Document = this.pdocworker;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(8, 72);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(576, 216);
this.tabControl1.TabIndex = 8;
this.tabControl1.Visible = false;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.txtremark);
this.tabPage1.Controls.Add(this.lblramark);
this.tabPage1.Controls.Add(this.btn);
this.tabPage1.Controls.Add(this.btnRe);
this.tabPage1.Controls.Add(this.btnaddwo);
this.tabPage1.Controls.Add(this.txteprizc);
this.tabPage1.Controls.Add(this.lblEprizc);
this.tabPage1.Controls.Add(this.txtEarning);
this.tabPage1.Controls.Add(this.lblEarning);
this.tabPage1.Controls.Add(this.txtEID);
this.tabPage1.Controls.Add(this.lblEID);
this.tabPage1.Location = new System.Drawing.Point(4, 21);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(568, 191);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "插入员工工资";
//
// txtremark
//
this.txtremark.Location = new System.Drawing.Point(88, 40);
this.txtremark.Multiline = true;
this.txtremark.Name = "txtremark";
this.txtremark.Size = new System.Drawing.Size(472, 80);
this.txtremark.TabIndex = 31;
this.txtremark.Text = "";
//
// lblramark
//
this.lblramark.Location = new System.Drawing.Point(8, 40);
this.lblramark.Name = "lblramark";
this.lblramark.Size = new System.Drawing.Size(72, 23);
this.lblramark.TabIndex = 30;
this.lblramark.Text = "备注:";
//
// btn
//
this.btn.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btn.Location = new System.Drawing.Point(479, 136);
this.btn.Name = "btn";
this.btn.TabIndex = 29;
this.btn.Text = "返回";
this.btn.Click += new System.EventHandler(this.btn_Click);
//
// btnRe
//
this.btnRe.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnRe.Location = new System.Drawing.Point(383, 136);
this.btnRe.Name = "btnRe";
this.btnRe.TabIndex = 28;
this.btnRe.Text = "重置";
this.btnRe.Click += new System.EventHandler(this.btnRe_Click);
//
// btnaddwo
//
this.btnaddwo.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnaddwo.Location = new System.Drawing.Point(287, 136);
this.btnaddwo.Name = "btnaddwo";
this.btnaddwo.TabIndex = 27;
this.btnaddwo.Text = "插入";
this.btnaddwo.Click += new System.EventHandler(this.btnaddwo_Click);
//
// txteprizc
//
this.txteprizc.Location = new System.Drawing.Point(440, 8);
this.txteprizc.Name = "txteprizc";
this.txteprizc.Size = new System.Drawing.Size(120, 21);
this.txteprizc.TabIndex = 24;
this.txteprizc.Text = "";
//
// lblEprizc
//
this.lblEprizc.Location = new System.Drawing.Point(344, 8);
this.lblEprizc.Name = "lblEprizc";
this.lblEprizc.Size = new System.Drawing.Size(80, 23);
this.lblEprizc.TabIndex = 23;
this.lblEprizc.Text = "员工奖金:";
//
// txtEarning
//
this.txtEarning.Location = new System.Drawing.Point(224, 8);
this.txtEarning.Name = "txtEarning";
this.txtEarning.Size = new System.Drawing.Size(112, 21);
this.txtEarning.TabIndex = 18;
this.txtEarning.Text = "";
//
// lblEarning
//
this.lblEarning.Location = new System.Drawing.Point(152, 8);
this.lblEarning.Name = "lblEarning";
this.lblEarning.Size = new System.Drawing.Size(72, 23);
this.lblEarning.TabIndex = 17;
this.lblEarning.Text = "员工工资:";
//
// txtEID
//
this.txtEID.Location = new System.Drawing.Point(88, 8);
this.txtEID.Name = "txtEID";
this.txtEID.Size = new System.Drawing.Size(64, 21);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -