📄 frmmoney.cs
字号:
using System;using System.Collections;using System.ComponentModel;using System.Drawing;using System.Windows.Forms;using System.Data;using System.Data.SqlClient;namespace 图书馆管理系统{ public class frmMoney : 图书馆管理系统.frmBase {
internal System.Windows.Forms.GroupBox GroupBox1;
internal System.Windows.Forms.TextBox txbMoney;
internal System.Windows.Forms.Label Label4;
internal System.Windows.Forms.Button btnSubmit;
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 图书馆管理系统.DataSet1 dataSet11; private System.ComponentModel.IContainer components = null; public frmMoney() { // 该调用是 Windows 窗体设计器所必需的。 InitializeComponent(); // TODO: 在 InitializeComponent 调用后添加任何初始化 } /// <summary> /// 清理所有正在使用的资源。 /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region 设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.GroupBox1 = new System.Windows.Forms.GroupBox();
this.txbMoney = new System.Windows.Forms.TextBox();
this.Label4 = new System.Windows.Forms.Label();
this.btnSubmit = new System.Windows.Forms.Button();
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.dataSet11 = new 图书馆管理系统.DataSet1();
((System.ComponentModel.ISupportInitialize)(this.dgdList)).BeginInit();
this.GroupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
this.SuspendLayout();
//
// dgdList
//
this.dgdList.Location = new System.Drawing.Point(6, 76);
this.dgdList.Name = "dgdList";
this.dgdList.Size = new System.Drawing.Size(498, 124);
//
// GroupBox1
//
this.GroupBox1.Controls.Add(this.txbMoney);
this.GroupBox1.Controls.Add(this.Label4);
this.GroupBox1.Controls.Add(this.btnSubmit);
this.GroupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.GroupBox1.Location = new System.Drawing.Point(0, 205);
this.GroupBox1.Name = "GroupBox1";
this.GroupBox1.Size = new System.Drawing.Size(506, 89);
this.GroupBox1.TabIndex = 7;
this.GroupBox1.TabStop = false;
//
// txbMoney
//
this.txbMoney.Location = new System.Drawing.Point(160, 36);
this.txbMoney.Name = "txbMoney";
this.txbMoney.Size = new System.Drawing.Size(83, 20);
this.txbMoney.TabIndex = 2;
this.txbMoney.Text = "";
//
// Label4
//
this.Label4.Location = new System.Drawing.Point(113, 41);
this.Label4.Name = "Label4";
this.Label4.Size = new System.Drawing.Size(47, 15);
this.Label4.TabIndex = 1;
this.Label4.Text = "实收金额";
//
// btnSubmit
//
this.btnSubmit.Location = new System.Drawing.Point(27, 37);
this.btnSubmit.Name = "btnSubmit";
this.btnSubmit.Size = new System.Drawing.Size(73, 21);
this.btnSubmit.TabIndex = 0;
this.btnSubmit.Text = "收回罚款金额";
this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
//
// 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_罚款日期 OR @Original_罚款日期 IS NULL AND 罚款日期 IS NULL) 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, 100, 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.Money, 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.Money, 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.Bit, 1, 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, 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));
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "workstation id=JEFF;packet size=4096;integrated security=SSPI;data source=JEFF;pe" +
"rsist security info=False;initial catalog=libbook";
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = "INSERT INTO 期刊罚款(罚款编号, 期刊编号, 读者编号, 罚款日期, 应罚金额, 实收金额, 是否交款, 备注) VALUES (@罚款编号, @期刊" +
"编号, @读者编号, @罚款日期, @应罚金额, @实收金额, @是否交款, @备注); SELECT 罚款编号, 期刊编号, 读者编号, 罚款日期, 应罚金额" +
", 实收金额, 是否交款, 备注 FROM 期刊罚款 WHERE (罚款编号 = @罚款编号)";
this.sqlInsertCommand1.Connection = this.sqlConnection1;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@罚款编号", System.Data.SqlDbType.Int, 4, "罚款编号"));
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, 20, "读者编号"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@罚款日期", System.Data.SqlDbType.DateTime, 4, "罚款日期"));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -