湖
www.hnsoftedu.com2727
南软件职业学院
string sql = @\v5.115.810.9015) */
SELECT 'FALSE' 选择,
b.bookname 图书名称, a.cardno 借阅证编号, a.bookno 图书编号, a.borrowdate 借阅日期, a.fine 罚金,
a.renewdate 续借日期, a.returndate 归还日期, a.borrowstate 状态
FROM borrowinfo a, bookinfo b WHERE a.bookno = b.bookno\; this.ug00_Borrow.DataSource = ConnectSqlServer.ExecuteSelect(sql);
//GabrielTool.standardizationUltraGrid(this.ug00_Borrow); }
//借书
private void b02_borrow_Click(object sender, EventArgs e) {
string sql1 = @\v5.115.810.9015) */
INSERT INTO borrowinfo values(':cardno', ':bookno', convert (datetime,':borrowdate'),
CONVERT (datetime,':borrowdate'),
NULL, 0,
'借阅中')\;
sql1 = sql1.Replace(\, this.t02_cardno.Text); sql1 = sql1.Replace(\, GabrielTool.getValue(this.t00_bookname));
sql1 = sql1.Replace(\,
this.t03_BorrDatetime.DateTime.ToString(\));
if (ConnectSqlServer.ExecuteChange(sql1) == 1) {
知识改变命运 - 27 - 软件成就未来
湖
www.hnsoftedu.com2828
南软件职业学院
MessageBox.Show(\添加成功!\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information);
this.b00_borrowInfoSelect_Click(null, null); this.Bind_t00_bookname(); } else {
MessageBox.Show(\插入数据出错,请检查后重试!\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
//还书
private void b03_return_Click(object sender, EventArgs e) {
string sql2 = @\v5.115.810.9015) */
UPDATE borrowinfo
SET RETURNDATE = GETDATE(), FINE = FINE + :fine, BORROWSTATE = '已还' WHERE bookno = ':bookno'\;
sql2 = sql2.Replace(\, GabrielTool.getValue(this.t00_bookname)); sql2 = sql2.Replace(\, GabrielTool.getValue(this.t04_fine));
if (ConnectSqlServer.ExecuteChange(sql2) == 1) {
MessageBox.Show(\还书成功!\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information);
this.b00_borrowInfoSelect_Click(null, null); } else {
MessageBox.Show(\还书出错,请检查后重试!\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
//续借
知识改变命运 - 28 - 软件成就未来
湖
www.hnsoftedu.com2929
南软件职业学院
private void b04_continue_Click(object sender, EventArgs e) {
string sql2 = @\
SET RENEWDATE = GETDATE(), FINE = FINE + :fine WHERE bookno = ':bookno'\;
sql2 = sql2.Replace(\, GabrielTool.getValue(this.t00_bookname)); sql2 = sql2.Replace(\, GabrielTool.getValue(this.t04_fine));
if (ConnectSqlServer.ExecuteChange(sql2) == 1) {
MessageBox.Show(\续借成功!\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information);
this.b00_borrowInfoSelect_Click(null, null); } else {
MessageBox.Show(\续借出错,请检查后重试!\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
//获得当前行信息
private void ug00_Borrow_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e) {
try {
GabrielTool.setValue(this.t00_bookname,
this.ug00_Borrow.ActiveRow.Cells[\图书编号\].Value.ToString()); this.t02_cardno.Text =
this.ug00_Borrow.ActiveRow.Cells[\借阅证编号\].Value.ToString(); this.t03_BorrDatetime.Value =
this.ug00_Borrow.ActiveRow.Cells[\借阅日期\].Value; GabrielTool.setValue(this.t04_fine,
this.ug00_Borrow.ActiveRow.Cells[\罚金\].Value.ToString()); }
catch (Exception ex)
知识改变命运 - 29 - 软件成就未来
湖
www.hnsoftedu.com3030
南软件职业学院
{
MessageBox.Show(\获得当前行信息出错!\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
//删除
private void b01_delete_Click(object sender, EventArgs e) {
string sql2 = @\v5.115.810.9015) */
delete from borrowinfo
WHERE bookno = ':bookno'\;
sql2 = sql2.Replace(\, GabrielTool.getValue(this.t00_bookname));
if (ConnectSqlServer.ExecuteChange(sql2) == 1) {
MessageBox.Show(\删除成功!\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information);
this.b00_borrowInfoSelect_Click(null, null); } else {
MessageBox.Show(\删除出错,请检查后重试!\, \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } 其他模块省略
知识改变命运 - 30 - 软件成就未来