Esempio n. 1
0
        private void btnAddRoom_Click(object sender, EventArgs e)
        {
            AddUpdateRoomForm addroomform = new AddUpdateRoomForm();

            addroomform.ShowDialog();
            this.roomSelectTableAdapter.Fill(this.hotel_BaseDataSet.RoomSelect);
        }
Esempio n. 2
0
        private void btnUpdateRoom_Click(object sender, EventArgs e)
        {
            int           rowindex    = dgvRooms.CurrentCell.RowIndex;
            List <string> cellsvalues = new List <string>();

            for (int i = 0; i < 5; i++)
            {
                cellsvalues.Add(dgvRooms.Rows[rowindex].Cells[i].Value.ToString());
            }

            AddUpdateRoomForm updateRoomForm = new AddUpdateRoomForm();

            updateRoomForm.Text             = "Update Room";
            updateRoomForm.btnOK.Text       = "Update";
            updateRoomForm.updateid         = int.Parse(cellsvalues[0]);
            updateRoomForm.tbRoomType.Text  = cellsvalues[1];
            updateRoomForm.tbMaxPeople.Text = cellsvalues[2];
            updateRoomForm.rtbOptions.Text  = cellsvalues[3];
            updateRoomForm.tbPrice.Text     = cellsvalues[4];
            updateRoomForm.changetype       = true;
            updateRoomForm.ShowDialog();
            this.roomSelectTableAdapter.Fill(this.hotel_BaseDataSet.RoomSelect);
        }