private void Setup() { SetupSimple(); try { actualData = manager.GetOne(Fillables.FillHotel, PrimaryKeys(0)); manager.Delete(PrimaryKeys(0)); } catch (Exception e) { } }
// PUT: api/Bookings/5 public bool Put(int id, [FromBody] Booking booking) { //bool settingsOk = bookingSettingsManager.Put(Extractables.ExtractBookingSettings(booking), PrimaryKeys(id)); bookedEventsManager.Delete(PrimaryKeys(id)); bool bookedOk = true; foreach (int eventId in booking.BookedEventsId) { bookedOk = bookedEventsManager.Post(Extractables.ExtractBookedEvents(booking.UserId, eventId)); } return(bookedOk); }
// DELETE: api/Admins/5 public bool Delete(int id) { bool adminDelete = adminManager.Delete(PrimaryKeys(id)); bool userDelete = false; if (adminDelete) { userDelete = userManager.Delete(PrimaryKeys(id)); } return(adminDelete && userDelete); }
// DELETE: api/Bookings/5 public bool Delete(int id) { bool settingsOk = bookingSettingsManager.Delete(PrimaryKeys(id)); bool bookedOk = false; if (settingsOk) { bookedOk = bookedEventsManager.Delete(PrimaryKeys(id)); } return(settingsOk && bookedOk); }
// DELETE: api/Speakers/5 public bool Delete(int id) { bool speakerOk = speakerManager.Delete(PrimaryKeys(id)); bool userOk = false; if (speakerOk) { userOk = userManager.Delete(PrimaryKeys(id)); } return(speakerOk && userOk); }
// PUT: api/Events/5 public bool Put(int id, [FromBody] Event sikonEvent) { bool eventOk = eventManager.Put(Extractables.ExtractEvent(sikonEvent), PrimaryKeys(id)); bool speakersInEventOk = false; if (eventOk) { speakersInEventManager.Delete(PrimaryKeys(id)); speakersInEventOk = true; foreach (Speaker speaker in sikonEvent.SpeakersInEvent) { speakersInEventOk = speakersInEventManager.Post(Extractables.ExtractSpeakersInEvent(sikonEvent.EventID, speaker.Id)); } } return(eventOk && speakersInEventOk); }
// DELETE: api/Users/5 public bool Delete(int id) { return(manager.Delete(PrimaryKeys(id))); }
public bool Delete(int roomNo, int hotelNo) { return(manager.Delete(PrimaryKeys(roomNo, hotelNo))); }
// DELETE: api/Events/5 public bool Delete(int id) { bool eventOk = eventManager.Delete(PrimaryKeys(id)); return(eventOk); }