private void DeleteFestivalExecute() { try { _dALFestival.DeleteFestival(Festival.Id); Festivals = _dALFestival.AllFestivals(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public IHttpActionResult DeleteFestival(int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Festival festival = _dALFestival.GetFestivalById(id); if (id != festival.Id) { return(BadRequest()); } festival.Deleted = true; _dALFestival.DeleteFestival(festival.Id); return(StatusCode(HttpStatusCode.NoContent)); }