private void showBookingWithType(int bookingId, string bookingType) { BookingServiceReference.Booking booking = bookingService.GetBooking(bookingId); if (bookingType == "ReadyToGo") { BookingServiceReference.ReadyToGo readyToGo = bookingService.GetReadyToGo(bookingId); //Viser formen ShowBookingForms.ShowReadyToGoForm showReadyToGoForm = new ShowReadyToGoForm(booking, readyToGo); showReadyToGoForm.Show(); } else if (bookingType == "Task") { BookingServiceReference.SupportTask supportTask = bookingService.GetSupportTask(bookingId); //Viser formen ShowBookingForms.ShowTaskForm showTaskForm = new ShowTaskForm(booking, supportTask); showTaskForm.Show(); } else if (bookingType == "SupportBooking") { BookingServiceReference.SupportBooking supportBooking = bookingService.GetSupportBooking(bookingId); //Viser formen ShowBookingForms.ShowSupportBookingForm showSupportBookingForm = new ShowSupportBookingForm(booking, supportBooking); showSupportBookingForm.Show(); } else { MessageBox.Show("Fejl kunne ikke hente booking typen", "Booking type fejl"); } }
private void lvViewCalendar_ItemActivate(object sender, EventArgs e) { ListViewItem item = listView.SelectedItems[0]; BookingServiceReference.Booking booking = item.Tag as BookingServiceReference.Booking; //Kalde metode showBookingWithType(booking.Id, booking.BookingType); }