📄 frmprize.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace 人力资源管理系统
{
/// <summary>
/// frmPrize 的摘要说明。
/// </summary>
public class frmPrize : System.Windows.Forms.Form
{
internal System.Data.SqlClient.SqlCommand SqlDeleteCommand1;
internal System.Data.SqlClient.SqlCommand SqlSelectCommand1;
internal System.Windows.Forms.DataGrid dgdPrizeInfo;
internal System.Data.SqlClient.SqlCommand SqlUpdateCommand1;
internal System.Windows.Forms.ImageList ImageList1;
internal System.Windows.Forms.ToolBarButton tbbSave;
internal System.Windows.Forms.ToolBarButton tbbDel;
internal System.Data.SqlClient.SqlCommand SqlInsertCommand1;
internal System.Windows.Forms.ToolBar ToolBar1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand2;
private System.Data.SqlClient.SqlCommand sqlInsertCommand2;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand2;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand2;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private 人力资源管理系统.DataSet1 dataSet11;
private System.ComponentModel.IContainer components;
public frmPrize()
{
//
// 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(frmPrize));
this.SqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.SqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.dgdPrizeInfo = new System.Windows.Forms.DataGrid();
this.SqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
this.ImageList1 = new System.Windows.Forms.ImageList(this.components);
this.tbbSave = new System.Windows.Forms.ToolBarButton();
this.tbbDel = new System.Windows.Forms.ToolBarButton();
this.SqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.ToolBar1 = new System.Windows.Forms.ToolBar();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlDeleteCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand2 = new System.Data.SqlClient.SqlCommand();
this.dataSet11 = new 人力资源管理系统.DataSet1();
((System.ComponentModel.ISupportInitialize)(this.dgdPrizeInfo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
this.SuspendLayout();
//
// 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.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));
//
// SqlSelectCommand1
//
this.SqlSelectCommand1.CommandText = "SELECT 序号, 职员编号, 奖励类型, 奖励金额, 是否计入工资, 奖励原因, 部门意见, 奖励日期 FROM 职员奖励表";
//
// dgdPrizeInfo
//
this.dgdPrizeInfo.CaptionVisible = false;
this.dgdPrizeInfo.DataMember = "";
this.dgdPrizeInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgdPrizeInfo.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgdPrizeInfo.Location = new System.Drawing.Point(0, 0);
this.dgdPrizeInfo.Name = "dgdPrizeInfo";
this.dgdPrizeInfo.Size = new System.Drawing.Size(384, 261);
this.dgdPrizeInfo.TabIndex = 15;
//
// 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.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, "序号"));
//
// 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;
//
// tbbSave
//
this.tbbSave.ImageIndex = 0;
this.tbbSave.ToolTipText = "保存修改记录或新增记录";
//
// tbbDel
//
this.tbbDel.ImageIndex = 1;
//
// SqlInsertCommand1
//
this.SqlInsertCommand1.CommandText = "INSERT INTO 职员奖励表(职员编号, 奖励类型, 奖励金额, 是否计入工资, 奖励原因, 部门意见, 奖励日期) VALUES (@职员编号, @奖励类" +
"型, @奖励金额, @是否计入工资, @奖励原因, @部门意见, @奖励日期); SELECT 序号, 职员编号, 奖励类型, 奖励金额, 是否计入工资, 奖励" +
"原因, 部门意见, 奖励日期 FROM 职员奖励表 WHERE (序号 = @@IDENTITY)";
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, "奖励日期"));
//
// ToolBar1
//
this.ToolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.tbbSave,
this.tbbDel});
this.ToolBar1.ButtonSize = new System.Drawing.Size(23, 22);
this.ToolBar1.DropDownArrows = true;
this.ToolBar1.ImageList = this.ImageList1;
this.ToolBar1.Location = new System.Drawing.Point(0, 0);
this.ToolBar1.Name = "ToolBar1";
this.ToolBar1.ShowToolTips = true;
this.ToolBar1.Size = new System.Drawing.Size(384, 28);
this.ToolBar1.TabIndex = 14;
this.ToolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.ToolBar1_ButtonClick);
//
// sqlDataAdapter1
//
this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand2;
this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -