/// <summary> /// 显示图书的详细信息 /// </summary> private void DisplayBookInfo() { if (this.dataGridView1.SelectedRows.Count != 0) { FrmBookInfo bookinfo = new FrmBookInfo(false); bookinfo.bookid.Text = this.dataGridView1.SelectedRows[0].Cells[0].Value.ToString().Trim(); bookinfo.ShowDialog(); } }
private void dataGridView1_DoubleClick(object sender, EventArgs e)//显示商品详细信息 { if (this.book.Checked) { if (this.dataGridView1.SelectedRows.Count != 0) { FrmBookInfo bookinfo = new FrmBookInfo(true); bookinfo.bookid.Text = this.dataGridView1.SelectedRows[0].Cells[0].Value.ToString().Trim(); bookinfo.ShowDialog(); } } else { if (this.dataGridView1.SelectedRows.Count != 0) { FrmCdInfo cdinfo = new FrmCdInfo(true); cdinfo.cdid.Text = this.dataGridView1.SelectedRows[0].Cells[0].Value.ToString().Trim(); cdinfo.ShowDialog(); } } }