private void InsertButton_Click(object sender, EventArgs e) { DeskEdit deskEdit = new DeskEdit(); deskEdit.ShowDialog(); this.DataRefresh(); }
private void UpdateButton_Click(object sender, EventArgs e) { if (dataGridView.CurrentRow != null) { int index = dataGridView.CurrentRow.Index; bool is_available = (bool)dataGridView.Rows[index].Cells["is_available"].Value; //如果座位上有人 if (is_available == false) { MessageBox.Show("当前状态不可修改"); } else { string desk_id = dataGridView.Rows[index].Cells["desk_id"].Value.ToString(); DeskEdit deskEdit = new DeskEdit(desk_id); deskEdit.ShowDialog(); } this.DataRefresh(); } else { MessageBox.Show("尚未选择数据"); } }