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

📄 book.cs

📁 数据库文件先要导入
💻 CS
📖 第 1 页 / 共 3 页
字号:
			this.groupBox1.Controls.Add(this.texI1);
			this.groupBox1.Controls.Add(this.label6);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.label5);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.label7);
			this.groupBox1.Location = new System.Drawing.Point(56, 24);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(464, 264);
			this.groupBox1.TabIndex = 8;
			this.groupBox1.TabStop = false;
			// 
			// texPr1
			// 
			this.texPr1.Location = new System.Drawing.Point(88, 88);
			this.texPr1.Name = "texPr1";
			this.texPr1.Size = new System.Drawing.Size(120, 21);
			this.texPr1.TabIndex = 16;
			this.texPr1.Text = "";
			// 
			// label21
			// 
			this.label21.AutoSize = true;
			this.label21.Location = new System.Drawing.Point(32, 88);
			this.label21.Name = "label21";
			this.label21.Size = new System.Drawing.Size(42, 17);
			this.label21.TabIndex = 15;
			this.label21.Text = "价格:";
			// 
			// texBZ1
			// 
			this.texBZ1.Location = new System.Drawing.Point(88, 152);
			this.texBZ1.Multiline = true;
			this.texBZ1.Name = "texBZ1";
			this.texBZ1.Size = new System.Drawing.Size(328, 88);
			this.texBZ1.TabIndex = 14;
			this.texBZ1.Text = "";
			// 
			// texC1
			// 
			this.texC1.Location = new System.Drawing.Point(296, 56);
			this.texC1.Name = "texC1";
			this.texC1.Size = new System.Drawing.Size(120, 21);
			this.texC1.TabIndex = 13;
			this.texC1.Text = "";
			// 
			// texP1
			// 
			this.texP1.Location = new System.Drawing.Point(88, 120);
			this.texP1.Name = "texP1";
			this.texP1.Size = new System.Drawing.Size(328, 21);
			this.texP1.TabIndex = 12;
			this.texP1.Text = "";
			// 
			// texA1
			// 
			this.texA1.Location = new System.Drawing.Point(296, 88);
			this.texA1.Name = "texA1";
			this.texA1.Size = new System.Drawing.Size(120, 21);
			this.texA1.TabIndex = 11;
			this.texA1.Text = "";
			// 
			// texT1
			// 
			this.texT1.Location = new System.Drawing.Point(88, 56);
			this.texT1.Name = "texT1";
			this.texT1.Size = new System.Drawing.Size(120, 21);
			this.texT1.TabIndex = 10;
			this.texT1.Text = "";
			// 
			// texN1
			// 
			this.texN1.Location = new System.Drawing.Point(296, 24);
			this.texN1.Name = "texN1";
			this.texN1.Size = new System.Drawing.Size(120, 21);
			this.texN1.TabIndex = 9;
			this.texN1.Text = "";
			// 
			// texI1
			// 
			this.texI1.Location = new System.Drawing.Point(88, 24);
			this.texI1.Name = "texI1";
			this.texI1.Size = new System.Drawing.Size(120, 21);
			this.texI1.TabIndex = 8;
			this.texI1.Text = "";
			// 
			// label6
			// 
			this.label6.AutoSize = true;
			this.label6.Location = new System.Drawing.Point(248, 56);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(42, 17);
			this.label6.TabIndex = 5;
			this.label6.Text = "数量:";
			// 
			// label2
			// 
			this.label2.AutoSize = true;
			this.label2.Location = new System.Drawing.Point(248, 24);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(42, 17);
			this.label2.TabIndex = 1;
			this.label2.Text = "书名:";
			// 
			// label5
			// 
			this.label5.AutoSize = true;
			this.label5.Location = new System.Drawing.Point(32, 120);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(54, 17);
			this.label5.TabIndex = 4;
			this.label5.Text = "出版社:";
			// 
			// label1
			// 
			this.label1.AutoSize = true;
			this.label1.Location = new System.Drawing.Point(32, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(42, 17);
			this.label1.TabIndex = 7;
			this.label1.Text = "ISBN:";
			// 
			// label4
			// 
			this.label4.AutoSize = true;
			this.label4.Location = new System.Drawing.Point(248, 88);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(42, 17);
			this.label4.TabIndex = 3;
			this.label4.Text = "作者:";
			// 
			// label3
			// 
			this.label3.AutoSize = true;
			this.label3.Location = new System.Drawing.Point(32, 56);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(42, 17);
			this.label3.TabIndex = 2;
			this.label3.Text = "类别:";
			// 
			// label7
			// 
			this.label7.AutoSize = true;
			this.label7.Location = new System.Drawing.Point(32, 144);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(42, 17);
			this.label7.TabIndex = 6;
			this.label7.Text = "备注:";
			// 
			// book
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(575, 421);
			this.Controls.Add(this.tabControl1);
			this.Name = "book";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "书籍信息管理";
			this.tabControl1.ResumeLayout(false);
			this.tabPage1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dG1)).EndInit();
			this.tabControl2.ResumeLayout(false);
			this.tabPage4.ResumeLayout(false);
			this.tabPage7.ResumeLayout(false);
			this.tabPage6.ResumeLayout(false);
			this.tabPage5.ResumeLayout(false);
			this.tabPage8.ResumeLayout(false);
			this.tabPage2.ResumeLayout(false);
			this.groupBox3.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.groupBox4.ResumeLayout(false);
			this.tabPage3.ResumeLayout(false);
			this.groupBox1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void button2_Click(object sender, System.EventArgs e)
		{
			texI1.Text="";
			texN1.Text="";
			texT1.Text="";
			texA1.Text="";
			texP1.Text="";
			texC1.Text="";
			texPr1.Text="";
			texBZ1.Text="";
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			if(texI1.Text=="")
			{
				MessageBox.Show("请输入ISBN!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			else
			{				
				if(texN1.Text=="")
				{
					MessageBox.Show("书名不能为空!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
				}	
				else
				{
					if(texT1.Text=="")
					{
						MessageBox.Show("请输入类别!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
					}
					else
					{
						if(texA1.Text=="")
						{
							MessageBox.Show("请输入作者!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
						}
						else
						{
							if(texP1.Text=="")
							{
								MessageBox.Show("请输入出版社!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
							}
							else
							{
								if(texC1.Text=="")
								{
									MessageBox.Show("请输入数量!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
								}
								else
								{
									lc.addbook(texI1.Text,texN1.Text,texT1.Text,texA1.Text,texP1.Text,texC1.Text,texPr1.Text,texBZ1.Text);
								}
							}
						}
					}
				}
			}	
		}

		private void button3_Click(object sender, System.EventArgs e)
		{
			string[] s=new string[8];
			if(rB1.Checked==true)
			{
				s=lc.selectbook("ISBN",tex.Text);
				texI2.Text=s[0];
				texBN2.Text=s[1];   
				texT2.Text=s[2];
				texBC2.Text=s[3];
				texPr2.Text=s[4];
				texA2.Text=s[5];
				texP2.Text=s[6];
				texBZ2.Text=s[7];
			}
			else
			{
				if(rB2.Checked==true)
				{
					s=lc.selectbook("BName",tex.Text);
					texI2.Text=s[0];
					texBN2.Text=s[1];   
					texT2.Text=s[2];
					texBC2.Text=s[3];
					texPr2.Text=s[4];
					texA2.Text=s[5];
					texP2.Text=s[6];
					texBZ2.Text=s[7];
				}
			}
		}

		private void button4_Click(object sender, System.EventArgs e)
		{
			lc.updatebook(texI2.Text,texBN2.Text,texT2.Text,texBC2.Text,texPr2.Text,texA2.Text,texP2.Text,texBZ2.Text);
		}

		private void button10_Click(object sender, System.EventArgs e)
		{
            lc.deletebook(texI2.Text);	
			texI2.Text="";
			texBN2.Text="";   
			texT2.Text="";
			texBC2.Text="";
			texPr2.Text="";
			texA2.Text="";
			texP2.Text="";
			texBZ2.Text="";
			tex.Text="";
		}

		private void rB1_CheckedChanged(object sender, System.EventArgs e)
		{
			if(rB1.Checked==true)
			{
				label12.Text="请输入ISBN:";
			}
			else
			{
				if(rB2.Checked==true)
				{
					label12.Text="请输入名称:";
				}
			}
		}

		private void rB2_CheckedChanged(object sender, System.EventArgs e)
		{
			if(rB1.Checked==true)
			{
				label12.Text="请输入ISBN:";
			}
			else
			{
				if(rB2.Checked==true)
				{
					label12.Text="请输入名称:";
				}
			}
		}

		private void button5_Click(object sender, System.EventArgs e)
		{
			SqlDataAdapter da=new SqlDataAdapter();
			DataSet ds=new DataSet();
			da=lc.setdsbook("ISBN",texI.Text);
			da.Fill(ds,"binfo");
			dG1.DataSource=ds;
			dG1.DataMember="binfo";
		}

		private void button8_Click(object sender, System.EventArgs e)
		{
			SqlDataAdapter da=new SqlDataAdapter();
			DataSet ds=new DataSet();
			da=lc.setdsbook("Author",texA.Text);
			da.Fill(ds,"binfo");
			dG1.DataSource=ds;
			dG1.DataMember="binfo";
		}

		private void button6_Click(object sender, System.EventArgs e)
		{
			SqlDataAdapter da=new SqlDataAdapter();
			DataSet ds=new DataSet();
			da=lc.setdsbook("BName",texBN.Text);
			da.Fill(ds,"binfo");
			dG1.DataSource=ds;
			dG1.DataMember="binfo";
		}

		private void button7_Click(object sender, System.EventArgs e)
		{
			SqlDataAdapter da=new SqlDataAdapter();
			DataSet ds=new DataSet();
			da=lc.setdsbook("Type",texT.Text);
			da.Fill(ds,"binfo");
			dG1.DataSource=ds;
			dG1.DataMember="binfo";
		}

		private void button9_Click(object sender, System.EventArgs e)
		{
			SqlDataAdapter da=new SqlDataAdapter();
			DataSet ds=new DataSet();
			da=lc.setdsbook("Publisher",texP.Text);
			da.Fill(ds,"binfo");
			dG1.DataSource=ds;
			dG1.DataMember="binfo";
		}

	}
}

⌨️ 快捷键说明

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