public ReturnBook(string id,int stock, Reader reader) { InitializeComponent(); this.correctID = id; this.stock = stock; this.reader = reader; }
public BorrowBook(Reader reader,string ISBN ,string id, string name, string author, string press, string date, string price,string content, string stock) { InitializeComponent(); this.correctID = id; this.txtISBN.Text = ISBN; this.txtName.Text = name; this.txtAuthor.Text = author; this.txtPress.Text = press; this.txtPressDate.Text = date; this.txtPrice.Text = price; this.txtContent.Text = content; this.lblStock.Text = stock; this.reader = reader; this.isbn = ISBN; try { //把封面显示到PictureBox中 this.pbCover.Image = booksInfo.getBookCover(ISBN); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnLogin_Click(object sender, EventArgs e) { if (radManager.Checked == true) { int read = userInfo.adminLogin(txtID.Text, txtPwd.Text); if (read > 0)//判断密码用户是否正确 { //登录成功 Manager manager = new Manager(this); this.Hide(); manager.Show(); } else { MessageBox.Show("登录失败!"); } } if (radReader.Checked == true) { //连接数据库,判断是否存在用户 int read = 0 ; read = userInfo.userLogin(txtID.Text.Trim(), txtPwd.Text.Trim()); if (read > 0)//判断密码用户是否正确 {//登录成功 this.Hide(); Reader reader = new Reader(txtID.Text,this); reader.Show(); } else { MessageBox.Show("登录失败!"); } } }