?? 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 + -