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

📄 book.cs

📁 《C#数据库项目案例导航》一书的配套光盘
💻 CS
📖 第 1 页 / 共 3 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Library.UserInterface;

namespace Library.UserInterface
{
	/// <summary>
	/// Book 的摘要说明。
	/// </summary>
	public class Book : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button btnDelete;
		private System.Windows.Forms.Label lblDatasetPosition;
		private System.Windows.Forms.Button btnPrevious;
		private System.Windows.Forms.Button btnNext;
		private System.Windows.Forms.Button btnLast;
		private System.Windows.Forms.Button btnFirst;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.TextBox textName;
		private System.Windows.Forms.TextBox textId;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Button btnExit;
		private System.Windows.Forms.GroupBox groupBox3;
		private System.Windows.Forms.Button btnAdd;
		private System.Windows.Forms.Button btnModify;
		private System.Windows.Forms.Button btnCancel;
		private System.Windows.Forms.Button btnApply;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label9;		
		private System.Windows.Forms.TextBox textWriter;
		private System.Windows.Forms.TextBox textPublish;
		private System.Windows.Forms.TextBox textPublishDate;
		private System.Windows.Forms.TextBox textSort;
		private System.Windows.Forms.TextBox textRemain;
		private System.Windows.Forms.TextBox textPrice;
		private System.Windows.Forms.TextBox textAmount;
		private System.Data.SqlClient.SqlConnection sqlConnection1;
		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 Library.UserInterface.DataSetBook objDataSetBook;
		
		//private Library.DataSetBook objDataSetBook;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Book()
		{
			//
			// 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()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Book));
			this.btnDelete = new System.Windows.Forms.Button();
			this.lblDatasetPosition = new System.Windows.Forms.Label();
			this.btnPrevious = new System.Windows.Forms.Button();
			this.btnNext = new System.Windows.Forms.Button();
			this.btnLast = new System.Windows.Forms.Button();
			this.btnFirst = new System.Windows.Forms.Button();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.textAmount = new System.Windows.Forms.TextBox();
			this.label9 = new System.Windows.Forms.Label();
			this.textPrice = new System.Windows.Forms.TextBox();
			this.textRemain = new System.Windows.Forms.TextBox();
			this.label8 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.textWriter = new System.Windows.Forms.TextBox();
			this.label7 = new System.Windows.Forms.Label();
			this.textPublish = new System.Windows.Forms.TextBox();
			this.textName = new System.Windows.Forms.TextBox();
			this.objDataSetBook = new Library.UserInterface.DataSetBook();
			this.textId = new System.Windows.Forms.TextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.textPublishDate = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.textSort = new System.Windows.Forms.TextBox();
			this.btnExit = new System.Windows.Forms.Button();
			this.groupBox3 = new System.Windows.Forms.GroupBox();
			this.btnAdd = new System.Windows.Forms.Button();
			this.btnModify = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.btnApply = new System.Windows.Forms.Button();
			this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
			this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
			this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
			this.groupBox1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.objDataSetBook)).BeginInit();
			this.groupBox3.SuspendLayout();
			this.SuspendLayout();
			// 
			// btnDelete
			// 
			this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnDelete.Location = new System.Drawing.Point(152, 24);
			this.btnDelete.Name = "btnDelete";
			this.btnDelete.Size = new System.Drawing.Size(56, 24);
			this.btnDelete.TabIndex = 28;
			this.btnDelete.Text = "删除";
			this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
			// 
			// lblDatasetPosition
			// 
			this.lblDatasetPosition.Anchor = System.Windows.Forms.AnchorStyles.Top;
			this.lblDatasetPosition.BackColor = System.Drawing.Color.White;
			this.lblDatasetPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.lblDatasetPosition.Location = new System.Drawing.Point(96, 32);
			this.lblDatasetPosition.Name = "lblDatasetPosition";
			this.lblDatasetPosition.Size = new System.Drawing.Size(56, 24);
			this.lblDatasetPosition.TabIndex = 25;
			this.lblDatasetPosition.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// btnPrevious
			// 
			this.btnPrevious.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnPrevious.Image = ((System.Drawing.Image)(resources.GetObject("btnPrevious.Image")));
			this.btnPrevious.Location = new System.Drawing.Point(64, 32);
			this.btnPrevious.Name = "btnPrevious";
			this.btnPrevious.Size = new System.Drawing.Size(32, 24);
			this.btnPrevious.TabIndex = 24;
			this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click);
			// 
			// btnNext
			// 
			this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnNext.Image = ((System.Drawing.Image)(resources.GetObject("btnNext.Image")));
			this.btnNext.Location = new System.Drawing.Point(152, 32);
			this.btnNext.Name = "btnNext";
			this.btnNext.Size = new System.Drawing.Size(32, 24);
			this.btnNext.TabIndex = 23;
			this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
			// 
			// btnLast
			// 
			this.btnLast.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnLast.Image = ((System.Drawing.Image)(resources.GetObject("btnLast.Image")));
			this.btnLast.Location = new System.Drawing.Point(184, 32);
			this.btnLast.Name = "btnLast";
			this.btnLast.Size = new System.Drawing.Size(32, 24);
			this.btnLast.TabIndex = 22;
			this.btnLast.Click += new System.EventHandler(this.btnLast_Click);
			// 
			// btnFirst
			// 
			this.btnFirst.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnFirst.Image = ((System.Drawing.Image)(resources.GetObject("btnFirst.Image")));
			this.btnFirst.Location = new System.Drawing.Point(32, 32);
			this.btnFirst.Name = "btnFirst";
			this.btnFirst.Size = new System.Drawing.Size(32, 24);
			this.btnFirst.TabIndex = 21;
			this.btnFirst.Click += new System.EventHandler(this.btnFirst_Click);
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.textAmount);
			this.groupBox1.Controls.Add(this.label9);
			this.groupBox1.Controls.Add(this.textPrice);
			this.groupBox1.Controls.Add(this.textRemain);
			this.groupBox1.Controls.Add(this.label8);
			this.groupBox1.Controls.Add(this.label6);
			this.groupBox1.Controls.Add(this.textWriter);
			this.groupBox1.Controls.Add(this.label7);
			this.groupBox1.Controls.Add(this.textPublish);
			this.groupBox1.Controls.Add(this.textName);
			this.groupBox1.Controls.Add(this.textId);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.textPublishDate);
			this.groupBox1.Controls.Add(this.label5);
			this.groupBox1.Controls.Add(this.textSort);
			this.groupBox1.Controls.Add(this.btnFirst);
			this.groupBox1.Controls.Add(this.btnLast);
			this.groupBox1.Controls.Add(this.btnNext);
			this.groupBox1.Controls.Add(this.btnPrevious);
			this.groupBox1.Controls.Add(this.lblDatasetPosition);
			this.groupBox1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.groupBox1.Location = new System.Drawing.Point(24, 24);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(464, 216);
			this.groupBox1.TabIndex = 20;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "图书信息维护";
			// 
			// textAmount
			// 
			this.textAmount.Location = new System.Drawing.Point(336, 144);
			this.textAmount.Name = "textAmount";
			this.textAmount.Size = new System.Drawing.Size(104, 23);
			this.textAmount.TabIndex = 31;
			this.textAmount.Text = "";
			// 
			// label9
			// 
			this.label9.Location = new System.Drawing.Point(256, 144);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(48, 23);
			this.label9.TabIndex = 30;
			this.label9.Text = "总册数";
			// 
			// textPrice
			// 
			this.textPrice.Location = new System.Drawing.Point(96, 174);
			this.textPrice.Name = "textPrice";
			this.textPrice.Size = new System.Drawing.Size(104, 23);
			this.textPrice.TabIndex = 29;
			this.textPrice.Text = "";
			// 
			// textRemain
			// 
			this.textRemain.Location = new System.Drawing.Point(336, 176);
			this.textRemain.Name = "textRemain";
			this.textRemain.Size = new System.Drawing.Size(104, 23);
			this.textRemain.TabIndex = 28;
			this.textRemain.Text = "";
			// 
			// label8
			// 
			this.label8.Location = new System.Drawing.Point(24, 176);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(72, 23);
			this.label8.TabIndex = 27;
			this.label8.Text = "图书价钱";
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(256, 176);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(48, 23);
			this.label6.TabIndex = 26;
			this.label6.Text = "库存量";
			// 
			// textWriter

⌨️ 快捷键说明

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