//添加房间 private void btnAddRoom_Click(object sender, EventArgs e) { RoomTypeModel room = new RoomTypeModel(); room.RTID1 = -1; EditingRoomForm editing = new EditingRoomForm(room); editing.Show(); }
//修改房间 private void btnUpdateRomm_Click(object sender, EventArgs e) { int index = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value); string name = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[1].Value.ToString(); int minMoney = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[2].Value); int flag = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[3].Value); int count = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[4].Value); RoomTypeModel room = new RoomTypeModel(index, name, minMoney, flag, count); EditingRoomForm editing = new EditingRoomForm(room); editing.Show(); }