📄 fakaframe.cs
字号:
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// textFaHao
//
this.textFaHao.Location = new System.Drawing.Point(112, 80);
this.textFaHao.Name = "textFaHao";
this.textFaHao.Size = new System.Drawing.Size(120, 21);
this.textFaHao.TabIndex = 9;
this.textFaHao.Text = "";
//
// label4
//
this.label4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label4.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label4.Location = new System.Drawing.Point(8, 77);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(88, 23);
this.label4.TabIndex = 8;
this.label4.Text = "ID卡号:";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label5
//
this.label5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label5.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label5.Location = new System.Drawing.Point(8, 29);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(88, 23);
this.label5.TabIndex = 7;
this.label5.Text = "职工号:";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnCancel
//
this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(544, 256);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(72, 24);
this.btnCancel.TabIndex = 15;
this.btnCancel.Text = "取消(&C)";
this.tool.SetToolTip(this.btnCancel, "此处关闭窗体");
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
this.btnCancel.MouseEnter += new System.EventHandler(this.btnOk_MouseEnter);
this.btnCancel.MouseLeave += new System.EventHandler(this.btnOk_MouseLeave);
//
// btnOk
//
this.btnOk.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOk.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnOk.Location = new System.Drawing.Point(320, 256);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(72, 24);
this.btnOk.TabIndex = 14;
this.btnOk.Text = "确定(&O)";
this.tool.SetToolTip(this.btnOk, "此处发卡操作");
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
this.btnOk.MouseEnter += new System.EventHandler(this.btnOk_MouseEnter);
this.btnOk.MouseLeave += new System.EventHandler(this.btnOk_MouseLeave);
//
// btnRemoveID
//
this.btnRemoveID.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRemoveID.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRemoveID.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnRemoveID.Location = new System.Drawing.Point(424, 256);
this.btnRemoveID.Name = "btnRemoveID";
this.btnRemoveID.Size = new System.Drawing.Size(96, 24);
this.btnRemoveID.TabIndex = 16;
this.btnRemoveID.Text = "删除卡号(&D)";
this.tool.SetToolTip(this.btnRemoveID, "此处出现对话框");
this.btnRemoveID.Click += new System.EventHandler(this.btnReadID_Click);
this.btnRemoveID.MouseEnter += new System.EventHandler(this.btnOk_MouseEnter);
this.btnRemoveID.MouseLeave += new System.EventHandler(this.btnOk_MouseLeave);
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.White;
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(656, 56);
this.pictureBox1.TabIndex = 17;
this.pictureBox1.TabStop = false;
//
// label6
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label6.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.label6.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label6.ForeColor = System.Drawing.Color.White;
this.label6.Location = new System.Drawing.Point(0, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(634, 40);
this.label6.TabIndex = 18;
this.label6.Text = "卡务操作";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnReadClipID
//
this.btnReadClipID.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnReadClipID.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReadClipID.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnReadClipID.Location = new System.Drawing.Point(536, 144);
this.btnReadClipID.Name = "btnReadClipID";
this.btnReadClipID.Size = new System.Drawing.Size(72, 24);
this.btnReadClipID.TabIndex = 19;
this.btnReadClipID.Text = "读号(&R)";
this.tool.SetToolTip(this.btnReadClipID, "此处读取号码");
this.btnReadClipID.Click += new System.EventHandler(this.btnReadClipID_Click);
//
// sqlDataAdapter
//
this.sqlDataAdapter.DeleteCommand = this.sqlDeleteCommand1;
this.sqlDataAdapter.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "BrushFrameHistory", 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.sqlDataAdapter.UpdateCommand = this.sqlUpdateCommand1;
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT 编号, 日期, 时间, 卡号, 姓名, 状态 FROM BrushFrameHistory";
this.sqlSelectCommand1.Connection = this.sqlConnection;
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = "INSERT INTO BrushFrameHistory(日期, 时间, 卡号, 姓名, 状态) VALUES (@日期, @时间, @卡号, @姓名, @状态" +
"); SELECT 编号, 日期, 时间, 卡号, 姓名, 状态 FROM BrushFrameHistory WHERE (编号 = @@IDENTITY)";
this.sqlInsertCommand1.Connection = this.sqlConnection;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@日期", System.Data.SqlDbType.DateTime, 8, "日期"));
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, 50, "卡号"));
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, 10, "状态"));
//
// sqlUpdateCommand1
//
this.sqlUpdateCommand1.CommandText = @"UPDATE BrushFrameHistory 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); SELECT 编号, 日期, 时间, 卡号, 姓名, 状态 FROM BrushFrameHistory WHERE (编号 = @编号)";
this.sqlUpdateCommand1.Connection = this.sqlConnection;
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@日期", System.Data.SqlDbType.DateTime, 8, "日期"));
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, 50, "卡号"));
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, 10, "状态"));
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.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.DateTime, 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, 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.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("@编号", System.Data.SqlDbType.Int, 4, "编号"));
//
// sqlDeleteCommand1
//
this.sqlDeleteCommand1.CommandText = @"DELETE FROM BrushFrameHistory 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)";
this.sqlDeleteCommand1.Connection = this.sqlConnection;
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.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.DateTime, 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, 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.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "状态", System.Data.DataRowVersion.Original, null));
//
// sqlConnection
//
this.sqlConnection.ConnectionString = "workstation id=localhost;integrated security=SSPI;database=SystemODBC";
//
// brushIDFrameSet
//
this.brushIDFrameSet.DataSetName = "BrushIDFrameSet";
this.brushIDFrameSet.Locale = new System.Globalization.CultureInfo("zh-CN");
//
// FaKaFrame
//
this.AutoScaleBaseSize = new System.Drawing.Size(7, 14);
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(634, 295);
this.Controls.Add(this.btnReadClipID);
this.Controls.Add(this.label6);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.btnRemoveID);
this.Controls.Add(this.groupBuKa);
this.Controls.Add(this.groupFaKa);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.btnCancel);
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FaKaFrame";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FaKaFrame";
this.Load += new System.EventHandler(this.FaKaFrame_Load);
this.groupBuKa.ResumeLayout(false);
this.groupFaKa.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.brushIDFrameSet)).EndInit();
this.ResumeLayout(false);
}
#endregion
#region 初始化变量...
private void FaKaFrame_Load(object sender, System.EventArgs e)
{
#region 获取卡号....
this.textFaHao.Text=StandInterfaceFrame.strResericePortIdData;
#endregion
#region 填充职工号下列表框....
try
{
this.dsEmployeeIDSet=conn.ExcuteDataSetResult(strEmployeeID,strEmployeeTableName);
this.dsEmpoyeeIDTable=this.dsEmployeeIDSet.Tables["Employee"];
for(int i=0;i<this.dsEmpoyeeIDTable.Rows.Count;i++)
{
this.empIDBu.Items.Add(this.dsEmpoyeeIDTable.Rows[i][0].ToString());
this.empIDFa.Items.Add(this.dsEmpoyeeIDTable.Rows[i][0].ToString());
}
}
catch(Exception exe)
{
MessageBox.Show(this,exe.ToString(),"提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
#endregion
#region 初始化变量...
try
{
DialogResult result=MessageBox.Show(this,"是否以新用户重新发卡啊!!!","提示信息",MessageBoxButtons.YesNo,MessageBoxIcon.Information);
if(result.Equals(DialogResult.Yes))
{
this.empIDFa.Text=AddOne();
}
else
{
return;
}
}
catch(Exception esle)
{
esle.ToString();
}
#endregion
}
#endregion
#region TextID加1的函数...
private String AddOne()
{
string temp="";
int MaxID=1;
try
{
string selectMaxStr="select max(职工号)职工号 from Employee";
object result=conn.ExcuteStrSqlObject(selectMaxStr);
if(!(result.Equals(System.DBNull.Value)))
{
MaxID=Convert.ToInt32(result)+1;
}
}
catch(Exception esle)
{
MessageBox.Show(this,esle.ToString(),"提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
temp=MaxID.ToString().Trim();
return temp;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -