Пример #1
0
        private void btnTransfer_Click(object sender, EventArgs e)
        {
            using (var db = DatabaseConnection.Connect())
            {
                int occupiedRoomId = int.Parse(txtOccupiedRoomId.Text);
                int vacantRoomId   = int.Parse(txtVacantRoomId.Text);

                // Changed to Room Id on TransactionRecord table
                UpdateTransferRoomModel transaction = new UpdateTransferRoomModel()
                {
                    RoomId        = vacantRoomId,
                    TransactionId = int.Parse(txtTransactionId.Text)
                };

                db.Query <UpdateTransferRoomModel>("UpdateTransferRoom", transaction, commandType: CommandType.StoredProcedure);

                // Changed the Room Status to Occupied
                db.QueryFirstOrDefault <int>("UpdateRoomToOccupied", new { roomId = vacantRoomId }, commandType: CommandType.StoredProcedure);

                // Changed the Room Status to Vacant
                db.QueryFirstOrDefault <int>("UpdateRoomToVacant", new { roomId = occupiedRoomId }, commandType: CommandType.StoredProcedure);

                this.Close();
                OccupiedRoomsForm occupiedRoomsForm = new OccupiedRoomsForm();
                occupiedRoomsForm.Show();
            }
        }
        private void btnOccupied_Click(object sender, EventArgs e)
        {
            OccupiedRoomsForm occupiedRoomsForm = new OccupiedRoomsForm();

            this.Hide();
            occupiedRoomsForm.Show();
        }
Пример #3
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Close();

            OccupiedRoomsForm occupiedRoomsForm = new OccupiedRoomsForm();

            occupiedRoomsForm.Show();
        }
        private void occupiedRoomsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();

            OccupiedRoomsForm occupiedRoomsForm = new OccupiedRoomsForm();

            occupiedRoomsForm.Show();
        }
Пример #5
0
        private void GuestInformationForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            OccupiedRoomsForm occupiedRoomsForm = new OccupiedRoomsForm();

            occupiedRoomsForm.Show();
        }