📄 frmissuebook.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace BookManagementSystem
{
public partial class frmIssueBook : Form
{
private Boolean b;
public frmIssueBook()
{
this.b = false;
InitializeComponent();
}
public frmIssueBook(string no, string name, string CountOfBook, string txt)
{
this.b = true;
InitializeComponent();
this.BookNo.Text = no;
this.BookName.Text = name;
this.CountOfBook.Text = CountOfBook;
this.synopsis.Text = txt;
}
private void frmIssueBook_Load(object sender, EventArgs e)
{
NoOfPersonal.Text = Program.CurrentAccount;
BookNo.ReadOnly = b;
BookName.ReadOnly = b;
button3.Enabled = !b;
//MessageBox.Show(IssueOfDate.Text);
this.AcceptButton = button1;
}
private void button1_Click(object sender, EventArgs e)
{
string[] sdata = new string[4];
sdata[0] = BookNo.Text;
sdata[1] = NoOfPersonal.Text;
sdata[2] = NameOfPersonal.Text;
sdata[3] = IssueOfDate.Text;
if (sdata[0] == "" || sdata[1] == "" || sdata[2] == "" || sdata[3]=="")
{
MessageBox.Show("资料不完整!");
return;
}
// MessageBox.Show(sdata[0]+" "+sdata[1]+" "+sdata[2]+" "+sdata[3]);
switch (Program.DataOperator.IssueBook(sdata))
{
case 1:
MessageBox.Show("你已借了这本书!");
break;
case 2:
MessageBox.Show("借书成功!");
this.Close();
break;
case 3:
MessageBox.Show("失败!");
this.Close();
break;
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void button3_Click(object sender, EventArgs e)
{
string []sdata = Program.DataOperator.ReturnBookNameContenAndCount(BookNo.Text);
if (sdata == null)
{
MessageBox.Show("没这本书");
return;
}
BookName.Text = sdata[0];
synopsis.Text = sdata[1];
CountOfBook.Text = sdata[2];
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -