private void mnu_Add_Click(object sender, EventArgs e)
        {
            FrmYiTingDetail frm = new FrmYiTingDetail();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                if (FindRow(frm.ReaderID) >= 0)
                {
                    MessageBox.Show("ID为 " + frm.ReaderID + " 的读卡器已经存在");
                }
                else
                {
                    int row = dataGridView1.Rows.Add();
                    ShowItemOnRow(dataGridView1.Rows[row], frm.ReaderID, frm.EntranceName, frm.EntranceID, frm.Memo);
                }
            }
        }
 private void mnu_Update_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count == 1)
     {
         FrmYiTingDetail frm = new FrmYiTingDetail();
         frm.ReaderID   = dataGridView1.SelectedRows[0].Cells["colReaderIP"].Value as string;
         frm.EntranceID = (int)dataGridView1.SelectedRows[0].Cells["colEntrance"].Tag;
         if (frm.ShowDialog() == DialogResult.OK)
         {
             if (FindRow(frm.ReaderID) != dataGridView1.SelectedRows[0].Index)
             {
                 MessageBox.Show("ID为 " + frm.ReaderID + " 的读卡器已经存在");
             }
             else
             {
                 ShowItemOnRow(dataGridView1.SelectedRows[0], frm.ReaderID, frm.EntranceName, frm.EntranceID, frm.Memo);
             }
         }
     }
 }