Ejemplo n.º 1
0
        /// <summary>
        /// 读者详情
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ReaderDetail(object sender, EventArgs e)
        {
            Reader reader = new Reader();

            if (dataGridView1.SelectedRows.Count <= 0)
            {
                MessageBox.Show("Not Exist!");
                return;
            }
            if (tmpTbl.Rows.Count <= 0)
            {
                MessageBox.Show("Not Exist!");
                return;
            }
            int       id = (int)dataGridView1.SelectedRows[0].Cells[0].Value;//书籍编号
            DataTable rt;

            try {
                rt = ReaderDAL.GetReaderByID(id);
            }catch (Exception ex) {
                MessageBox.Show("获取详细信息失败,当前用户非法!" + ex.Message);
                return;
            }

            reader = Reader.RowsToReader(rt.Rows);

            UserDetailForm bdf = new UserDetailForm(reader);

            bdf.Show();
        }