⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 backqueryinfo.cs

📁 图书馆管理系统为方便读者
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.comboBox2.DisplayMember = "Treturninfo.typename";
			this.comboBox2.Location = new System.Drawing.Point(80, 56);
			this.comboBox2.Name = "comboBox2";
			this.comboBox2.Size = new System.Drawing.Size(121, 20);
			this.comboBox2.TabIndex = 7;
			// 
			// comboBox1
			// 
			this.comboBox1.DataSource = this.returnquery1;
			this.comboBox1.DisplayMember = "Treturninfo.typeno";
			this.comboBox1.Location = new System.Drawing.Point(80, 24);
			this.comboBox1.Name = "comboBox1";
			this.comboBox1.Size = new System.Drawing.Size(121, 20);
			this.comboBox1.TabIndex = 6;
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(16, 88);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(56, 23);
			this.label5.TabIndex = 4;
			this.label5.Text = "备注";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(216, 56);
			this.label4.Name = "label4";
			this.label4.TabIndex = 3;
			this.label4.Text = "借书天数:";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(216, 24);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(72, 23);
			this.label3.TabIndex = 2;
			this.label3.Text = "书籍编号:";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(16, 56);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(72, 23);
			this.label2.TabIndex = 1;
			this.label2.Text = "读者姓名:";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(16, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(72, 23);
			this.label1.TabIndex = 0;
			this.label1.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", "Treturninfo", new System.Data.Common.DataColumnMapping[] {
																																																					 new System.Data.Common.DataColumnMapping("typeno", "typeno"),
																																																					 new System.Data.Common.DataColumnMapping("typename", "typename"),
																																																					 new System.Data.Common.DataColumnMapping("bookno", "bookno"),
																																																					 new System.Data.Common.DataColumnMapping("bookdays", "bookdays"),
																																																					 new System.Data.Common.DataColumnMapping("memo", "memo")})});
			this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
			// 
			// sqlDeleteCommand1
			// 
			this.sqlDeleteCommand1.CommandText = @"DELETE FROM Treturninfo WHERE (typeno = @Original_typeno) AND (bookdays = @Original_bookdays OR @Original_bookdays IS NULL AND bookdays IS NULL) AND (bookno = @Original_bookno OR @Original_bookno IS NULL AND bookno IS NULL) AND (memo = @Original_memo OR @Original_memo IS NULL AND memo IS NULL) AND (typename = @Original_typename)";
			this.sqlDeleteCommand1.Connection = this.sqlConnection1;
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_typeno", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "typeno", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_bookdays", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "bookdays", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_bookno", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "bookno", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_memo", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "memo", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_typename", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "typename", System.Data.DataRowVersion.Original, null));
			// 
			// sqlConnection1
			// 
			this.sqlConnection1.ConnectionString = "data source =222.20.54.54;initial catalog =yuan;user id=sa;password=0517;";
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = "INSERT INTO Treturninfo(typeno, typename, bookno, bookdays, memo) VALUES (@typeno" +
				", @typename, @bookno, @bookdays, @memo); SELECT typeno, typename, bookno, bookda" +
				"ys, memo FROM Treturninfo WHERE (typeno = @typeno)";
			this.sqlInsertCommand1.Connection = this.sqlConnection1;
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@typeno", System.Data.SqlDbType.NVarChar, 50, "typeno"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@typename", System.Data.SqlDbType.NVarChar, 50, "typename"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@bookno", System.Data.SqlDbType.NVarChar, 50, "bookno"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@bookdays", System.Data.SqlDbType.NVarChar, 50, "bookdays"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@memo", System.Data.SqlDbType.NVarChar, 50, "memo"));
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "SELECT typeno, typename, bookno, bookdays, memo FROM Treturninfo";
			this.sqlSelectCommand1.Connection = this.sqlConnection1;
			// 
			// sqlUpdateCommand1
			// 
			this.sqlUpdateCommand1.CommandText = @"UPDATE Treturninfo SET typeno = @typeno, typename = @typename, bookno = @bookno, bookdays = @bookdays, memo = @memo WHERE (typeno = @Original_typeno) AND (bookdays = @Original_bookdays OR @Original_bookdays IS NULL AND bookdays IS NULL) AND (bookno = @Original_bookno OR @Original_bookno IS NULL AND bookno IS NULL) AND (memo = @Original_memo OR @Original_memo IS NULL AND memo IS NULL) AND (typename = @Original_typename); SELECT typeno, typename, bookno, bookdays, memo FROM Treturninfo WHERE (typeno = @typeno)";
			this.sqlUpdateCommand1.Connection = this.sqlConnection1;
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@typeno", System.Data.SqlDbType.NVarChar, 50, "typeno"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@typename", System.Data.SqlDbType.NVarChar, 50, "typename"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@bookno", System.Data.SqlDbType.NVarChar, 50, "bookno"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@bookdays", System.Data.SqlDbType.NVarChar, 50, "bookdays"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@memo", System.Data.SqlDbType.NVarChar, 50, "memo"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_typeno", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "typeno", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_bookdays", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "bookdays", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_bookno", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "bookno", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_memo", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "memo", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_typename", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "typename", System.Data.DataRowVersion.Original, null));
			// 
			// backqueryinfo
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(448, 246);
			this.Controls.Add(this.groupBox1);
			this.Name = "backqueryinfo";
			this.Text = "还书信息查询";
			this.Load += new System.EventHandler(this.backqueryinfo_Load);
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.returnquery1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void backqueryinfo_Load(object sender, System.EventArgs e)
		{
			sqlSelectCommand1.CommandText ="";
			if(cmdstring1!=""&&cmdstring2!="")
			{
				sqlSelectCommand1.CommandText ="select * from Treturninfo where typeno= '"+cmdstring1;
				sqlSelectCommand1.CommandText+="'"+"and typename ='"+cmdstring2+"'";
			}
			if(cmdstring1==""&&cmdstring2!="")
			{
				sqlSelectCommand1.CommandText ="select * from Treturninfo where typename ='"+cmdstring2+"'";
			}
			if(cmdstring1!=""&&cmdstring2=="")
			{
				sqlSelectCommand1.CommandText ="select * from Treturninfo where typeno= '"+cmdstring1+"'";
			}
			sqlDataAdapter1.Fill (returnquery1);
		
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -