public static CircuBookClass queryBookInfo(string circuBookNo) { string sql = "select bookName,publishingHouse from circuBookClass, circuBook where circuBook.isbn = circuBookClass.isbn and circuBook.circuBookNo =(select circuBookNo from borrowRecord where circuBookNo=@circuBookNo and returnTime is null)"; SqlParameter para = new SqlParameter("@circuBookNo", circuBookNo); SQLHelper.CoverToObject cto = new SQLHelper.CoverToObject(ReaderToBkPH); var list = SQLHelper.Query(sql, cto, para); CircuBookClass cBookc = list[0] as CircuBookClass; return(cBookc); }
public static CircuBookClass montorTextBox1Changed(string astring) { CircuBookClass cBookc; try { cBookc = DAL.BookInfo.queryBookInfo(astring); } catch (ArgumentOutOfRangeException) { cBookc = new CircuBookClass(null, null); } return(cBookc); }
private void textBox1_TextChanged(object sender, EventArgs e) { if (this.textBox1.Text.Length == 10) { BrokenCheckBox.CheckState = CheckState.Unchecked; CircuBookClass cBookc = BLL.RetrunWinAS.montorTextBox1Changed(this.textBox1.Text); this.textBox2.Text = cBookc.BookName; this.textBox3.Text = cBookc.PublishingHouse; } if (this.textBox1.Text.Length != 10) { label2.Enabled = false; this.textBox2.Text = null; this.textBox3.Text = null; BrokenCheckBox.Enabled = false; comboBox1.Text = null; button1.Enabled = false; } }
private void textBox9_TextChanged_1(object sender, EventArgs e) { String circuBookNo = textBox9.Text; textBox11.Text = ""; textBox10.Text = ""; label7.Text = ""; label7.ForeColor = Color.Red; bookBorrowAble = false; checkBorrowAble(); if (circuBookNo.Length == 10) { try { CircuBookClass book = BookInfo.queryABookInfo(circuBookNo); textBox11.Text = book.BookName; textBox10.Text = book.PublishingHouse; } catch (System.ArgumentOutOfRangeException) { label7.Text = "图书标识号有误!"; return; } if (!AS.BookBorrowAble(textBox9.Text)) { label7.Text = "书籍已被借出!"; } else { label7.ForeColor = Color.Green; label7.Text = "该书籍可借阅"; bookBorrowAble = true; checkBorrowAble(); } } }