//添加餐桌 private void btnAddMeal_Click(object sender, EventArgs e) { TablesModel tables = new TablesModel(); tables.RTID1 = -1; TheTableEditorForm tableEditor = new TheTableEditorForm(tables); tableEditor.Show(); }
//修改餐桌 private void btnUpdateMeal_Click(object sender, EventArgs e) { int index = Convert.ToInt32(dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells[0].Value); string name = dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells[1].Value.ToString(); string area = dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells[3].Value.ToString(); int start = 0; TablesModel tables = new TablesModel(index, name, 0, area, start); TheTableEditorForm tableEditor = new TheTableEditorForm(tables); tableEditor.Show(); }