//修改餐桌 private void btnUpdateDesk_Click(object sender, EventArgs e) { if (dgvDeskInfo.SelectedRows.Count > 0) { //获取选中餐桌的id int id = Convert.ToInt32(dgvDeskInfo.SelectedRows[0].Cells[0].Value); //根据餐桌的id查询该行数据,返回的是餐桌的对象 DeskInfoBLL bll = new DeskInfoBLL(); DeskInfo dk = bll.GetDeskInfoByDeskId(id); dk.DeskId = id; fea.obj = dk; ShowFrmChangeDesk(4); } }
//修改餐桌 private void btnUpdateDesk_Click(object sender, EventArgs e) { if (dgvDeskInfo.SelectedRows.Count > 0) { int id = Convert.ToInt32(dgvDeskInfo.SelectedRows[0].Cells[0].Value); DeskInfo desk = new DeskInfo(); DeskInfoBLL bll = new DeskInfoBLL(); desk = bll.GetDeskInfoByDeskId(id); if (desk != null) { feas.obj = desk; desk.DeskId = id; ShowFrmChangeDesk(2); } } else { MessageBox.Show("请选择要修改的数据"); } }