📄 query.cs
字号:
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookPrice", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookPrice", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookPublish", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookPublish", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookPublishDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookPublishDate", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookRemain", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookRemain", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookSort", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookSort", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookWriter", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookWriter", System.Data.DataRowVersion.Original, null));
//
// sqlInsertCommand2
//
this.sqlInsertCommand2.CommandText = @"INSERT INTO Book(BookID, BookName, BookWriter, BookPublish, BookPublishDate, BookPrice, BookSort, BookAmount, BookRemain) VALUES (@BookID, @BookName, @BookWriter, @BookPublish, @BookPublishDate, @BookPrice, @BookSort, @BookAmount, @BookRemain); SELECT BookID, BookName, BookWriter, BookPublish, BookPublishDate, BookPrice, BookSort, BookAmount, BookRemain FROM Book WHERE (BookID = @BookID)";
this.sqlInsertCommand2.Connection = this.sqlConnection1;
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookID", System.Data.SqlDbType.NVarChar, 10, "BookID"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookName", System.Data.SqlDbType.NVarChar, 30, "BookName"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookWriter", System.Data.SqlDbType.NVarChar, 20, "BookWriter"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookPublish", System.Data.SqlDbType.NVarChar, 50, "BookPublish"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookPublishDate", System.Data.SqlDbType.DateTime, 8, "BookPublishDate"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookPrice", System.Data.SqlDbType.Float, 8, "BookPrice"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookSort", System.Data.SqlDbType.NVarChar, 20, "BookSort"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookAmount", System.Data.SqlDbType.Int, 4, "BookAmount"));
this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookRemain", System.Data.SqlDbType.Int, 4, "BookRemain"));
//
// sqlSelectCommand2
//
this.sqlSelectCommand2.CommandText = "SELECT BookID, BookName, BookWriter, BookPublish, BookPublishDate, BookPrice, Boo" +
"kSort, BookAmount, BookRemain FROM Book";
this.sqlSelectCommand2.Connection = this.sqlConnection1;
//
// sqlUpdateCommand2
//
this.sqlUpdateCommand2.CommandText = @"UPDATE Book SET BookID = @BookID, BookName = @BookName, BookWriter = @BookWriter, BookPublish = @BookPublish, BookPublishDate = @BookPublishDate, BookPrice = @BookPrice, BookSort = @BookSort, BookAmount = @BookAmount, BookRemain = @BookRemain WHERE (BookID = @Original_BookID) AND (BookAmount = @Original_BookAmount OR @Original_BookAmount IS NULL AND BookAmount IS NULL) AND (BookName = @Original_BookName OR @Original_BookName IS NULL AND BookName IS NULL) AND (BookPrice = @Original_BookPrice OR @Original_BookPrice IS NULL AND BookPrice IS NULL) AND (BookPublish = @Original_BookPublish OR @Original_BookPublish IS NULL AND BookPublish IS NULL) AND (BookPublishDate = @Original_BookPublishDate OR @Original_BookPublishDate IS NULL AND BookPublishDate IS NULL) AND (BookRemain = @Original_BookRemain OR @Original_BookRemain IS NULL AND BookRemain IS NULL) AND (BookSort = @Original_BookSort OR @Original_BookSort IS NULL AND BookSort IS NULL) AND (BookWriter = @Original_BookWriter OR @Original_BookWriter IS NULL AND BookWriter IS NULL); SELECT BookID, BookName, BookWriter, BookPublish, BookPublishDate, BookPrice, BookSort, BookAmount, BookRemain FROM Book WHERE (BookID = @BookID)";
this.sqlUpdateCommand2.Connection = this.sqlConnection1;
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookID", System.Data.SqlDbType.NVarChar, 10, "BookID"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookName", System.Data.SqlDbType.NVarChar, 30, "BookName"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookWriter", System.Data.SqlDbType.NVarChar, 20, "BookWriter"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookPublish", System.Data.SqlDbType.NVarChar, 50, "BookPublish"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookPublishDate", System.Data.SqlDbType.DateTime, 8, "BookPublishDate"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookPrice", System.Data.SqlDbType.Float, 8, "BookPrice"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookSort", System.Data.SqlDbType.NVarChar, 20, "BookSort"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookAmount", System.Data.SqlDbType.Int, 4, "BookAmount"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookRemain", System.Data.SqlDbType.Int, 4, "BookRemain"));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookID", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookID", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookAmount", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookAmount", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookName", System.Data.SqlDbType.NVarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookName", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookPrice", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookPrice", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookPublish", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookPublish", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookPublishDate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookPublishDate", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookRemain", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookRemain", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookSort", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookSort", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BookWriter", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BookWriter", System.Data.DataRowVersion.Original, null));
//
// comboCondition
//
this.comboCondition.Items.AddRange(new object[] {
"=",
">",
">=",
"<",
"<=",
"<>",
"Like"});
this.comboCondition.Location = new System.Drawing.Point(224, 48);
this.comboCondition.Name = "comboCondition";
this.comboCondition.Size = new System.Drawing.Size(80, 20);
this.comboCondition.TabIndex = 12;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.comboDataTable);
this.groupBox1.Controls.Add(this.comboDataItem);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.textValue);
this.groupBox1.Controls.Add(this.comboCondition);
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(424, 96);
this.groupBox1.TabIndex = 13;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "查询条件";
//
// sqlDataAdapterPublish
//
this.sqlDataAdapterPublish.DeleteCommand = this.sqlDeleteCommand3;
this.sqlDataAdapterPublish.InsertCommand = this.sqlInsertCommand3;
this.sqlDataAdapterPublish.SelectCommand = this.sqlSelectCommand3;
this.sqlDataAdapterPublish.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "PublishCompany", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("PublishName", "PublishName"),
new System.Data.Common.DataColumnMapping("PublishAddress", "PublishAddress"),
new System.Data.Common.DataColumnMapping("PublishPhoneNo", "PublishPhoneNo"),
new System.Data.Common.DataColumnMapping("PbulishEmail", "PbulishEmail")})});
this.sqlDataAdapterPublish.UpdateCommand = this.sqlUpdateCommand3;
//
// sqlDeleteCommand3
//
this.sqlDeleteCommand3.CommandText = @"DELETE FROM PublishCompany WHERE (PublishName = @Original_PublishName) AND (PbulishEmail = @Original_PbulishEmail OR @Original_PbulishEmail IS NULL AND PbulishEmail IS NULL) AND (PublishAddress = @Original_PublishAddress OR @Original_PublishAddress IS NULL AND PublishAddress IS NULL) AND (PublishPhoneNo = @Original_PublishPhoneNo OR @Original_PublishPhoneNo IS NULL AND PublishPhoneNo IS NULL)";
this.sqlDeleteCommand3.Connection = this.sqlConnection1;
this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PublishName", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PublishName", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PbulishEmail", System.Data.SqlDbType.NVarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PbulishEmail", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PublishAddress", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PublishAddress", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PublishPhoneNo", System.Data.SqlDbType.NVarChar, 15, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PublishPhoneNo", System.Data.DataRowVersion.Original, null));
//
// sqlInsertCommand3
//
this.sqlInsertCommand3.CommandText = @"INSERT INTO PublishCompany(PublishName, PublishAddress, PublishPhoneNo, PbulishEmail) VALUES (@PublishName, @PublishAddress, @PublishPhoneNo, @PbulishEmail); SELECT PublishName, PublishAddress, PublishPhoneNo, PbulishEmail FROM PublishCompany WHERE (PublishName = @PublishName)";
this.sqlInsertCommand3.Connection = this.sqlConnection1;
this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PublishName", System.Data.SqlDbType.NVarChar, 50, "PublishName"));
this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PublishAddress", System.Data.SqlDbType.NVarChar, 50, "PublishAddress"));
this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PublishPhoneNo", System.Data.SqlDbType.NVarChar, 15, "PublishPhoneNo"));
this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PbulishEmail", System.Data.SqlDbType.NVarChar, 30, "PbulishEmail"));
//
// sqlSelectCommand3
//
this.sqlSelectCommand3.CommandText = "SELECT PublishName, PublishAddress, PublishPhoneNo, PbulishEmail FROM PublishComp" +
"any";
this.sqlSelectCommand3.Connection = this.sqlConnection1;
//
// sqlUpdateCommand3
//
this.sqlUpdateCommand3.CommandText = @"UPDATE PublishCompany SET PublishName = @PublishName, PublishAddress = @PublishAddress, PublishPhoneNo = @PublishPhoneNo, PbulishEmail = @PbulishEmail WHERE (PublishName = @Original_PublishName) AND (PbulishEmail = @Original_PbulishEmail OR @Original_PbulishEmail IS NULL AND PbulishEmail IS NULL) AND (PublishAddress = @Original_PublishAddress OR @Original_PublishAddress IS NULL AND PublishAddress IS NULL) AND (PublishPhoneNo = @Original_PublishPhoneNo OR @Original_PublishPhoneNo IS NULL AND PublishPhoneNo IS NULL); SELECT PublishName, PublishAddress, PublishPhoneNo, PbulishEmail FROM PublishCompany WHERE (PublishName = @PublishName)";
this.sqlUpdateCommand3.Connection = this.sqlConnection1;
this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PublishName", System.Data.SqlDbType.NVarChar, 50, "PublishName"));
this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PublishAddress", System.Data.SqlDbType.NVarChar, 50, "PublishAddress"));
this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PublishPhoneNo", System.Data.SqlDbType.NVarChar, 15, "PublishPhoneNo"));
this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PbulishEmail", System.Data.SqlDbType.NVarChar, 30, "PbulishEmail"));
this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PublishName", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PublishName", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PbulishEmail", System.Data.SqlDbType.NVarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PbulishEmail", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PublishAddress", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PublishAddress", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PublishPhoneNo", System.Data.SqlDbType.NVarChar, 15, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PublishPhoneNo", System.Data.DataRowVersion.Original, null));
//
// sqlDataAdapterBorrow
//
this.sqlDataAdapterBorrow.InsertCommand = this.sqlInsertCommand4;
this.sqlDataAdapterBorrow.SelectCommand = this.sqlSelectCommand4;
this.sqlDataAdapterBorrow.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "Borrow", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("ReaderID", "ReaderID"),
new System.Data.Common.DataColumnMapping("ReaderName", "ReaderName"),
new System.Data.Common.DataColumnMapping("ReaderPhoneNo", "ReaderPhoneNo"),
new System.Data.Common.DataColumnMapping("BookID", "BookID"),
new System.Data.Common.DataColumnMapping("BookName", "BookName"),
new System.Data.Common.DataColumnMapping("BookWriter", "BookWriter"),
new System.Data.Common.DataColumnMapping("BorrowDate", "BorrowDate"),
new System.Data.Common.DataColumnMapping("ReturnDate", "ReturnDate")})});
//
// sqlInsertCommand4
//
this.sqlInsertCommand4.CommandText = @"INSERT INTO Borrow(ReaderID, ReaderName, ReaderPhoneNo, BookID, BookName, BookWriter, BorrowDate, ReturnDate) VALUES (@ReaderID, @ReaderName, @ReaderPhoneNo, @BookID, @BookName, @BookWriter, @BorrowDate, @ReturnDate); SELECT ReaderID, ReaderName, ReaderPhoneNo, BookID, BookName, BookWriter, BorrowDate, ReturnDate FROM Borrow";
this.sqlInsertCommand4.Connection = this.sqlConnection1;
this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReaderID", System.Data.SqlDbType.NVarChar, 6, "ReaderID"));
this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReaderName", System.Data.SqlDbType.NVarChar, 20, "ReaderName"));
this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReaderPhoneNo", System.Data.SqlDbType.NVarChar, 15, "ReaderPhoneNo"));
this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookID", System.Data.SqlDbType.NVarChar, 10, "BookID"));
this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookName", System.Data.SqlDbType.NVarChar, 30, "BookName"));
this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BookWriter", System.Data.SqlDbType.NVarChar, 20, "BookWriter"));
this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BorrowDate", System.Data.SqlDbType.DateTime, 8, "BorrowDate"));
this.sqlInsertCommand4.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReturnDate", System.Data.SqlDbType.DateTime, 8, "ReturnDate"));
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -