private void but_xiugai_Click(object sender, EventArgs e) { try { //判断是否选择了一行 if (DGV_info.SelectedRows.Count == 1) { Frm_WaiterXG xg = new Frm_WaiterXG(); xg.ID = DGV_info.SelectedRows[0].Cells["Column1"].Value.ToString().Trim(); xg.ShowDialog(); } else { MessageBox.Show("请选择要修改的员工信息"); } } catch { } }
private void but_add_Click(object sender, EventArgs e) { Frm_WaiterXG xg = new Frm_WaiterXG(); xg.ShowDialog(); }