Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
PunishmentManage.cs
Package: VCSDB.rar [view]
Upload User: hjieqiu
Upload Date: 2013-05-11
Package Size: 16494k
Code Size: 26k
Category:
ERP-EIP-OA-Portal
Development Platform:
C#
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- namespace 人力资源管理系统
- {
- /// <summary>
- /// PunishmentManage 的摘要说明。
- /// </summary>
- public class PunishmentManage : System.Windows.Forms.Form
- {
- private CurrencyManager cmManage;
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.TextBox txt1;
- private System.Windows.Forms.TextBox txt2;
- private System.Windows.Forms.TextBox txt3;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.Label label18;
- private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
- 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 sqlConnection1;
- private System.Windows.Forms.TextBox txt7;
- private System.Windows.Forms.TextBox txt6;
- private System.Windows.Forms.TextBox txt5;
- private System.Windows.Forms.TextBox txt4;
- private 人力资源管理系统.DataSet1 dataSet11;
- private System.Windows.Forms.ToolBarButton toolBarFirst;
- private System.Windows.Forms.ToolBarButton toolBarPre;
- private System.Windows.Forms.ToolBarButton toolBarNext;
- private System.Windows.Forms.ToolBarButton toolBarLast;
- private System.Windows.Forms.ToolBarButton tbarBtnNew;
- private System.Windows.Forms.ToolBarButton tbarBtnDelete;
- private System.Windows.Forms.ToolBarButton toolBarSubmit;
- private System.Windows.Forms.ToolBar toolBar;
- private System.Windows.Forms.ToolBarButton toolBarCancel;
- private System.Windows.Forms.ToolBarButton toolBarQuit;
- private System.Windows.Forms.ImageList imageList1;
- private System.ComponentModel.IContainer components;
- public PunishmentManage()
- {
- //
- // 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()
- {
- this.components = new System.ComponentModel.Container();
- System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PunishmentManage));
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.txt7 = new System.Windows.Forms.TextBox();
- this.dataSet11 = new 人力资源管理系统.DataSet1();
- this.txt6 = new System.Windows.Forms.TextBox();
- this.txt1 = new System.Windows.Forms.TextBox();
- this.txt2 = new System.Windows.Forms.TextBox();
- this.txt5 = new System.Windows.Forms.TextBox();
- this.txt3 = new System.Windows.Forms.TextBox();
- this.txt4 = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.label8 = new System.Windows.Forms.Label();
- this.label18 = new System.Windows.Forms.Label();
- this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
- this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
- this.sqlConnection1 = 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.toolBar = new System.Windows.Forms.ToolBar();
- this.toolBarFirst = new System.Windows.Forms.ToolBarButton();
- this.toolBarPre = new System.Windows.Forms.ToolBarButton();
- this.toolBarNext = new System.Windows.Forms.ToolBarButton();
- this.toolBarLast = new System.Windows.Forms.ToolBarButton();
- this.tbarBtnNew = new System.Windows.Forms.ToolBarButton();
- this.tbarBtnDelete = new System.Windows.Forms.ToolBarButton();
- this.toolBarSubmit = new System.Windows.Forms.ToolBarButton();
- this.toolBarCancel = new System.Windows.Forms.ToolBarButton();
- this.toolBarQuit = new System.Windows.Forms.ToolBarButton();
- this.imageList1 = new System.Windows.Forms.ImageList(this.components);
- this.groupBox1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).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.Controls.Add(this.txt7);
- this.groupBox1.Controls.Add(this.txt6);
- this.groupBox1.Controls.Add(this.txt1);
- this.groupBox1.Controls.Add(this.txt2);
- this.groupBox1.Controls.Add(this.txt5);
- this.groupBox1.Controls.Add(this.txt3);
- this.groupBox1.Controls.Add(this.txt4);
- this.groupBox1.Controls.Add(this.label3);
- this.groupBox1.Controls.Add(this.label4);
- this.groupBox1.Controls.Add(this.label5);
- this.groupBox1.Controls.Add(this.label6);
- this.groupBox1.Controls.Add(this.label7);
- this.groupBox1.Controls.Add(this.label8);
- this.groupBox1.Controls.Add(this.label18);
- this.groupBox1.Location = new System.Drawing.Point(0, 46);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(528, 250);
- this.groupBox1.TabIndex = 5;
- this.groupBox1.TabStop = false;
- //
- // txt7
- //
- this.txt7.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "职员惩罚表.部门意见"));
- this.txt7.Location = new System.Drawing.Point(312, 192);
- this.txt7.Name = "txt7";
- this.txt7.Size = new System.Drawing.Size(192, 21);
- this.txt7.TabIndex = 6;
- this.txt7.Text = "";
- //
- // dataSet11
- //
- this.dataSet11.DataSetName = "DataSet1";
- this.dataSet11.Locale = new System.Globalization.CultureInfo("zh-CN");
- //
- // txt6
- //
- this.txt6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "职员惩罚表.惩罚原因"));
- this.txt6.Location = new System.Drawing.Point(40, 192);
- this.txt6.Name = "txt6";
- this.txt6.Size = new System.Drawing.Size(232, 21);
- this.txt6.TabIndex = 5;
- this.txt6.Text = "";
- //
- // txt1
- //
- this.txt1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "职员惩罚表.职员编号"));
- this.txt1.Location = new System.Drawing.Point(40, 72);
- this.txt1.Name = "txt1";
- this.txt1.Size = new System.Drawing.Size(88, 21);
- this.txt1.TabIndex = 0;
- this.txt1.Text = "";
- //
- // txt2
- //
- this.txt2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "职员惩罚表.惩罚类型"));
- this.txt2.Location = new System.Drawing.Point(144, 72);
- this.txt2.Name = "txt2";
- this.txt2.Size = new System.Drawing.Size(356, 21);
- this.txt2.TabIndex = 1;
- this.txt2.Text = "";
- //
- // txt5
- //
- this.txt5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "职员惩罚表.是否计入工资"));
- this.txt5.Location = new System.Drawing.Point(400, 136);
- this.txt5.Name = "txt5";
- this.txt5.Size = new System.Drawing.Size(104, 21);
- this.txt5.TabIndex = 4;
- this.txt5.Text = "";
- //
- // txt3
- //
- this.txt3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "职员惩罚表.惩罚金额"));
- this.txt3.Location = new System.Drawing.Point(40, 136);
- this.txt3.Name = "txt3";
- this.txt3.Size = new System.Drawing.Size(136, 21);
- this.txt3.TabIndex = 2;
- this.txt3.Text = "";
- //
- // txt4
- //
- this.txt4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "职员惩罚表.惩罚日期"));
- this.txt4.Location = new System.Drawing.Point(192, 136);
- this.txt4.Name = "txt4";
- this.txt4.Size = new System.Drawing.Size(192, 21);
- this.txt4.TabIndex = 3;
- this.txt4.Text = "";
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(400, 112);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(88, 16);
- this.label3.TabIndex = 19;
- this.label3.Text = "是否记入工资";
- //
- // label4
- //
- this.label4.Location = new System.Drawing.Point(40, 168);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(64, 16);
- this.label4.TabIndex = 19;
- this.label4.Text = "惩罚原因";
- //
- // label5
- //
- this.label5.Location = new System.Drawing.Point(312, 168);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(64, 16);
- this.label5.TabIndex = 19;
- this.label5.Text = "部门意见";
- //
- // label6
- //
- this.label6.Location = new System.Drawing.Point(144, 48);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(64, 16);
- this.label6.TabIndex = 19;
- this.label6.Text = "惩罚类型";
- //
- // label7
- //
- this.label7.Location = new System.Drawing.Point(192, 112);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(64, 16);
- this.label7.TabIndex = 19;
- this.label7.Text = "惩罚日期";
- //
- // label8
- //
- this.label8.Location = new System.Drawing.Point(40, 48);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(64, 16);
- this.label8.TabIndex = 19;
- this.label8.Text = "职员编号";
- //
- // label18
- //
- this.label18.Location = new System.Drawing.Point(40, 112);
- this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(64, 16);
- this.label18.TabIndex = 19;
- this.label18.Text = "惩罚金额";
- //
- // sqlDataAdapter1
- //
- this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
- this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
- this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
- this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
- new System.Data.Common.DataTableMapping("Table", "职员惩罚表", new System.Data.Common.DataColumnMapping[] {
- new System.Data.Common.DataColumnMapping("序号", "序号"),
- new System.Data.Common.DataColumnMapping("职员编号", "职员编号"),
- new System.Data.Common.DataColumnMapping("惩罚类型", "惩罚类型"),
- new System.Data.Common.DataColumnMapping("惩罚金额", "惩罚金额"),
- new System.Data.Common.DataColumnMapping("是否计入工资", "是否计入工资"),
- new System.Data.Common.DataColumnMapping("惩罚原因", "惩罚原因"),
- new System.Data.Common.DataColumnMapping("部门意见", "部门意见"),
- new System.Data.Common.DataColumnMapping("惩罚日期", "惩罚日期")})});
- this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
- //
- // sqlDeleteCommand1
- //
- this.sqlDeleteCommand1.CommandText = @"DELETE FROM 职员惩罚表 WHERE (序号 = @Original_序号) AND (惩罚原因 = @Original_惩罚原因 OR @Original_惩罚原因 IS NULL AND 惩罚原因 IS NULL) AND (惩罚日期 = @Original_惩罚日期 OR @Original_惩罚日期 IS NULL AND 惩罚日期 IS NULL) AND (惩罚类型 = @Original_惩罚类型 OR @Original_惩罚类型 IS NULL AND 惩罚类型 IS NULL) AND (惩罚金额 = @Original_惩罚金额 OR @Original_惩罚金额 IS NULL AND 惩罚金额 IS NULL) AND (是否计入工资 = @Original_是否计入工资 OR @Original_是否计入工资 IS NULL AND 是否计入工资 IS NULL) AND (职员编号 = @Original_职员编号) AND (部门意见 = @Original_部门意见 OR @Original_部门意见 IS NULL AND 部门意见 IS NULL)";
- this.sqlDeleteCommand1.Connection = this.sqlConnection1;
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_序号", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "序号", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_惩罚原因", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "惩罚原因", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_惩罚日期", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "惩罚日期", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_惩罚类型", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "惩罚类型", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_惩罚金额", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "惩罚金额", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_是否计入工资", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "是否计入工资", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_职员编号", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "职员编号", System.Data.DataRowVersion.Original, null));
- this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_部门意见", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "部门意见", System.Data.DataRowVersion.Original, null));
- //
- // sqlConnection1
- //
- this.sqlConnection1.ConnectionString = "workstation id=localhost;Integrated Security=SSPI;Database=hrmbook;";
- //
- // sqlInsertCommand1
- //
- this.sqlInsertCommand1.CommandText = "INSERT INTO 职员惩罚表(职员编号, 惩罚类型, 惩罚金额, 是否计入工资, 惩罚原因, 部门意见, 惩罚日期) VALUES (@职员编号, @惩罚类" +
- "型, @惩罚金额, @是否计入工资, @惩罚原因, @部门意见, @惩罚日期); SELECT 序号, 职员编号, 惩罚类型, 惩罚金额, 是否计入工资, 惩罚" +
- "原因, 部门意见, 惩罚日期 FROM 职员惩罚表 WHERE (序号 = @@IDENTITY)";
- this.sqlInsertCommand1.Connection = this.sqlConnection1;
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@职员编号", System.Data.SqlDbType.VarChar, 30, "职员编号"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@惩罚类型", System.Data.SqlDbType.VarChar, 20, "惩罚类型"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@惩罚金额", System.Data.SqlDbType.Float, 8, "惩罚金额"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@是否计入工资", System.Data.SqlDbType.VarChar, 10, "是否计入工资"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@惩罚原因", System.Data.SqlDbType.VarChar, 50, "惩罚原因"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@部门意见", System.Data.SqlDbType.VarChar, 100, "部门意见"));
- this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@惩罚日期", System.Data.SqlDbType.Int, 4, "惩罚日期"));
- //
- // sqlSelectCommand1
- //
- this.sqlSelectCommand1.CommandText = "SELECT 序号, 职员编号, 惩罚类型, 惩罚金额, 是否计入工资, 惩罚原因, 部门意见, 惩罚日期 FROM 职员惩罚表";
- this.sqlSelectCommand1.Connection = this.sqlConnection1;
- //
- // sqlUpdateCommand1
- //
- this.sqlUpdateCommand1.CommandText = @"UPDATE 职员惩罚表 SET 职员编号 = @职员编号, 惩罚类型 = @惩罚类型, 惩罚金额 = @惩罚金额, 是否计入工资 = @是否计入工资, 惩罚原因 = @惩罚原因, 部门意见 = @部门意见, 惩罚日期 = @惩罚日期 WHERE (序号 = @Original_序号) AND (惩罚原因 = @Original_惩罚原因 OR @Original_惩罚原因 IS NULL AND 惩罚原因 IS NULL) AND (惩罚日期 = @Original_惩罚日期 OR @Original_惩罚日期 IS NULL AND 惩罚日期 IS NULL) AND (惩罚类型 = @Original_惩罚类型 OR @Original_惩罚类型 IS NULL AND 惩罚类型 IS NULL) AND (惩罚金额 = @Original_惩罚金额 OR @Original_惩罚金额 IS NULL AND 惩罚金额 IS NULL) AND (是否计入工资 = @Original_是否计入工资 OR @Original_是否计入工资 IS NULL AND 是否计入工资 IS NULL) AND (职员编号 = @Original_职员编号) AND (部门意见 = @Original_部门意见 OR @Original_部门意见 IS NULL AND 部门意见 IS NULL); SELECT 序号, 职员编号, 惩罚类型, 惩罚金额, 是否计入工资, 惩罚原因, 部门意见, 惩罚日期 FROM 职员惩罚表 WHERE (序号 = @序号)";
- this.sqlUpdateCommand1.Connection = this.sqlConnection1;
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@职员编号", System.Data.SqlDbType.VarChar, 30, "职员编号"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@惩罚类型", System.Data.SqlDbType.VarChar, 20, "惩罚类型"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@惩罚金额", System.Data.SqlDbType.Float, 8, "惩罚金额"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@是否计入工资", System.Data.SqlDbType.VarChar, 10, "是否计入工资"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@惩罚原因", System.Data.SqlDbType.VarChar, 50, "惩罚原因"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@部门意见", System.Data.SqlDbType.VarChar, 100, "部门意见"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@惩罚日期", System.Data.SqlDbType.Int, 4, "惩罚日期"));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_序号", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "序号", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_惩罚原因", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "惩罚原因", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_惩罚日期", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "惩罚日期", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_惩罚类型", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "惩罚类型", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_惩罚金额", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "惩罚金额", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_是否计入工资", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "是否计入工资", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_职员编号", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "职员编号", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_部门意见", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "部门意见", System.Data.DataRowVersion.Original, null));
- this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@序号", System.Data.SqlDbType.Int, 4, "序号"));
- //
- // toolBar
- //
- this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
- this.toolBarFirst,
- this.toolBarPre,
- this.toolBarNext,
- this.toolBarLast,
- this.tbarBtnNew,
- this.tbarBtnDelete,
- this.toolBarSubmit,
- this.toolBarCancel,
- this.toolBarQuit});
- this.toolBar.DropDownArrows = true;
- this.toolBar.ImageList = this.imageList1;
- this.toolBar.Location = new System.Drawing.Point(0, 0);
- this.toolBar.Name = "toolBar";
- this.toolBar.ShowToolTips = true;
- this.toolBar.Size = new System.Drawing.Size(528, 41);
- this.toolBar.TabIndex = 26;
- this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);
- //
- // toolBarFirst
- //
- this.toolBarFirst.ImageIndex = 0;
- this.toolBarFirst.Text = "首记录";
- this.toolBarFirst.ToolTipText = "首记录";
- //
- // toolBarPre
- //
- this.toolBarPre.ImageIndex = 1;
- this.toolBarPre.Text = "上一记录";
- this.toolBarPre.ToolTipText = "上一记录";
- //
- // toolBarNext
- //
- this.toolBarNext.ImageIndex = 2;
- this.toolBarNext.Text = "下一记录";
- this.toolBarNext.ToolTipText = "下一记录";
- //
- // toolBarLast
- //
- this.toolBarLast.ImageIndex = 3;
- this.toolBarLast.Text = "尾记录";
- this.toolBarLast.ToolTipText = "尾记录";
- //
- // tbarBtnNew
- //
- this.tbarBtnNew.ImageIndex = 4;
- this.tbarBtnNew.Text = "新增记录";
- this.tbarBtnNew.ToolTipText = "新增记录";
- //
- // tbarBtnDelete
- //
- this.tbarBtnDelete.ImageIndex = 5;
- this.tbarBtnDelete.Text = "删除记录";
- this.tbarBtnDelete.ToolTipText = "删除记录";
- //
- // toolBarSubmit
- //
- this.toolBarSubmit.ImageIndex = 6;
- this.toolBarSubmit.Text = "提交修改";
- this.toolBarSubmit.ToolTipText = "提交修改";
- //
- // toolBarCancel
- //
- this.toolBarCancel.ImageIndex = 7;
- this.toolBarCancel.Text = "取消修改";
- this.toolBarCancel.ToolTipText = "取消修改";
- //
- // toolBarQuit
- //
- this.toolBarQuit.ImageIndex = 8;
- this.toolBarQuit.Text = "退出";
- this.toolBarQuit.ToolTipText = "退出";
- //
- // imageList1
- //
- this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
- this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- //
- // PunishmentManage
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.ClientSize = new System.Drawing.Size(528, 357);
- this.Controls.Add(this.toolBar);
- this.Controls.Add(this.groupBox1);
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "PunishmentManage";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "【职员惩罚管理】";
- this.Load += new System.EventHandler(this.PunishmentManage_Load);
- this.groupBox1.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- //--------------------初始化窗体,读入数据------------------
- private void PunishmentManage_Load(object sender, System.EventArgs e)
- {
- this.sqlDataAdapter1.Fill(this.dataSet11.职员惩罚表);
- cmManage = (CurrencyManager) BindingContext[this.dataSet11,"职员惩罚表"];
- }
- //------------------处理数据导航条和新增修改等事务---------------------
- private void toolBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
- {
- if (e.Button.ToolTipText == "首记录")
- {
- cmManage.Position = 0;
- return;
- }
- if (e.Button.ToolTipText == "上一记录")
- {
- if (cmManage.Position > 0)
- cmManage.Position--;
- return;
- }
- if (e.Button.ToolTipText == "下一记录")
- {
- if (cmManage.Position < cmManage.Count-1)
- cmManage.Position++;
- return;
- }
- if (e.Button.ToolTipText == "尾记录")
- {
- cmManage.Position = cmManage.Count-1;
- return;
- }
- if (e.Button.ToolTipText == "新增记录")
- {
- cmManage.AddNew();
- return;
- }
- if (e.Button.ToolTipText == "删除记录")
- {
- if (MessageBox.Show(" 确实要删除这条记录吗?","询问",MessageBoxButtons.YesNo) == DialogResult.Yes)
- {
- if (cmManage.Count > 0)
- cmManage.RemoveAt(cmManage.Position);
- else
- {
- MessageBox.Show("没有可以删除的数据","提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- }
- return;
- }
- }
- if (e.Button.ToolTipText == "提交修改")
- {
- if (this.txt1.Text.Trim() == "")
- {
- MessageBox.Show("职员编号不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- return;
- }
- cmManage.EndCurrentEdit();
- if (this.dataSet11.职员惩罚表.GetChanges() != null)
- {
- try
- {
- this.sqlDataAdapter1.Update(this.dataSet11.职员惩罚表);
- }
- catch(Exception express)
- {
- MessageBox.Show(express.ToString(),"提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- }
- }
- return;
- }
- if (e.Button.ToolTipText == "取消修改")
- {
- try
- {
- cmManage.CancelCurrentEdit(); //取消编辑
- }
- catch(Exception express)
- {
- MessageBox.Show(express.ToString(),"提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
- }
- return;
- }
- if (e.Button.ToolTipText == "退出")
- {
- this.Close();
- }
- }
- }
- }