📄 reader.cs
字号:
//
// button1
//
this.button1.Location = new System.Drawing.Point(136, 328);
this.button1.Name = "button1";
this.button1.TabIndex = 11;
this.button1.Text = "确定";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.texBZ1);
this.groupBox1.Controls.Add(this.label26);
this.groupBox1.Controls.Add(this.rB2);
this.groupBox1.Controls.Add(this.rB1);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.texP1);
this.groupBox1.Controls.Add(this.texN1);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.texE1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.texPW1);
this.groupBox1.Location = new System.Drawing.Point(56, 32);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(456, 264);
this.groupBox1.TabIndex = 10;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "请输入读者信息";
//
// texBZ1
//
this.texBZ1.Location = new System.Drawing.Point(272, 77);
this.texBZ1.Multiline = true;
this.texBZ1.Name = "texBZ1";
this.texBZ1.Size = new System.Drawing.Size(152, 128);
this.texBZ1.TabIndex = 12;
this.texBZ1.Text = "";
//
// label26
//
this.label26.AutoSize = true;
this.label26.Location = new System.Drawing.Point(272, 48);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(42, 17);
this.label26.TabIndex = 11;
this.label26.Text = "备注:";
//
// rB2
//
this.rB2.Location = new System.Drawing.Point(152, 80);
this.rB2.Name = "rB2";
this.rB2.Size = new System.Drawing.Size(40, 24);
this.rB2.TabIndex = 10;
this.rB2.Text = "女";
//
// rB1
//
this.rB1.Checked = true;
this.rB1.Location = new System.Drawing.Point(96, 80);
this.rB1.Name = "rB1";
this.rB1.Size = new System.Drawing.Size(48, 24);
this.rB1.TabIndex = 9;
this.rB1.TabStop = true;
this.rB1.Text = "男";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(24, 112);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(42, 17);
this.label3.TabIndex = 2;
this.label3.Text = "密码:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(24, 152);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(66, 17);
this.label4.TabIndex = 3;
this.label4.Text = "密码验证:";
//
// texP1
//
this.texP1.Location = new System.Drawing.Point(96, 112);
this.texP1.Name = "texP1";
this.texP1.PasswordChar = '*';
this.texP1.Size = new System.Drawing.Size(144, 21);
this.texP1.TabIndex = 6;
this.texP1.Text = "";
//
// texN1
//
this.texN1.Location = new System.Drawing.Point(96, 48);
this.texN1.Name = "texN1";
this.texN1.Size = new System.Drawing.Size(144, 21);
this.texN1.TabIndex = 5;
this.texN1.Text = "";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(24, 48);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(42, 17);
this.label1.TabIndex = 0;
this.label1.Text = "姓名:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(24, 184);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(54, 17);
this.label5.TabIndex = 4;
this.label5.Text = "E-Mail:";
//
// texE1
//
this.texE1.Location = new System.Drawing.Point(96, 184);
this.texE1.Name = "texE1";
this.texE1.Size = new System.Drawing.Size(144, 21);
this.texE1.TabIndex = 8;
this.texE1.Text = "";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(24, 80);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(42, 17);
this.label2.TabIndex = 1;
this.label2.Text = "性别:";
//
// texPW1
//
this.texPW1.Location = new System.Drawing.Point(96, 152);
this.texPW1.Name = "texPW1";
this.texPW1.PasswordChar = '*';
this.texPW1.Size = new System.Drawing.Size(144, 21);
this.texPW1.TabIndex = 7;
this.texPW1.Text = "";
//
// reader
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(575, 421);
this.Controls.Add(this.tabControl1);
this.Name = "reader";
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.tabPage5.ResumeLayout(false);
this.tabPage6.ResumeLayout(false);
this.tabPage7.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 button1_Click(object sender, System.EventArgs e)
{
if(texN1.Text=="")
{
MessageBox.Show("姓名不能为空!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
if(texP1.Text=="")
{
MessageBox.Show("密码不能为空!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
if(texPW1.Text=="")
{
MessageBox.Show("请输入密码验证!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
if(texP1.Text!=texPW1.Text)
{
MessageBox.Show("两次输入的密码不一致!","信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
if(rB1.Checked==true)
{
lc.addreader(texN1.Text,rB1.Text,texP1.Text,texE1.Text,texBZ1.Text);
}
else
{
if(rB2.Checked==true)
{
lc.addreader(texN1.Text,rB2.Text,texP1.Text,texE1.Text,texBZ1.Text);
}
}
}
}
}
}
}
private void button2_Click(object sender, System.EventArgs e)
{
texN1.Text="";
rB1.Checked=true;
rB2.Checked=false;
texP1.Text="";
texPW1.Text="";
texE1.Text="";
texBZ1.Text="";
}
private void button3_Click(object sender, System.EventArgs e)
{
string[] s=new string[5];
if(radioButton1.Checked==true)
{
s=lc.selectreader("RID",tex.Text);
texID2.Text=s[0];
texN2.Text=s[1];
texS2.Text=s[2];
texE2.Text=s[3];
texBZ2.Text=s[4];
}
else
{
if(radioButton2.Checked==true)
{
s=lc.selectreader("RName",tex.Text);
texID2.Text=s[0];
texN2.Text=s[1];
texS2.Text=s[2];
texE2.Text=s[3];
texBZ2.Text=s[4];
}
}
}
private void radioButton1_CheckedChanged(object sender, System.EventArgs e)
{
if(radioButton1.Checked==true)
{
label6.Text="请输入编号:";
}
else
{
if(radioButton2.Checked==true)
{
label6.Text="请输入姓名:";
}
}
}
private void radioButton2_CheckedChanged(object sender, System.EventArgs e)
{
if(radioButton1.Checked==true)
{
label6.Text="请输入编号:";
}
else
{
if(radioButton2.Checked==true)
{
label6.Text="请输入姓名:";
}
}
}
private void button4_Click(object sender, System.EventArgs e)
{
lc.updatereader(texID2.Text,texN2.Text,texS2.Text,texE2.Text,texBZ2.Text);
}
private void button5_Click(object sender, System.EventArgs e)
{
SqlDataAdapter da=new SqlDataAdapter();
DataSet ds=new DataSet();
da=lc.setds1("r.RID",texID3.Text);
da.Fill(ds,"info");
dG1.DataSource=ds;
dG1.DataMember="info";
}
private void button6_Click(object sender, System.EventArgs e)
{
SqlDataAdapter da=new SqlDataAdapter();
DataSet ds=new DataSet();
da=lc.setds1("r.RName",texN4.Text);
da.Fill(ds,"info");
dG1.DataSource=ds;
dG1.DataMember="info";
}
private void button7_Click(object sender, System.EventArgs e)
{
SqlDataAdapter da=new SqlDataAdapter();
DataSet ds=new DataSet();
da=lc.setds1("b.BName",texB5.Text);
da.Fill(ds,"info");
dG1.DataSource=ds;
dG1.DataMember="info";
}
private void button8_Click(object sender, System.EventArgs e)
{
SqlDataAdapter da=new SqlDataAdapter();
DataSet ds=new DataSet();
da=lc.setds2("r.RID","b.BName",texB6.Text,texBN6.Text);
da.Fill(ds,"info");
dG1.DataSource=ds;
dG1.DataMember="info";
}
private void button9_Click(object sender, System.EventArgs e)
{
SqlDataAdapter da=new SqlDataAdapter();
DataSet ds=new DataSet();
da=lc.setds2("r.RName","b.BName",texN7.Text,texBN7.Text);
da.Fill(ds,"info");
dG1.DataSource=ds;
dG1.DataMember="info";
}
private void button10_Click(object sender, System.EventArgs e)
{
lc.deletereader(texID2.Text);
texID2.Text="";
texN2.Text="";
texS2.Text="";
texE2.Text="";
texBZ2.Text="";
tex.Text="";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -