public IHttpActionResult PutFestival(int id, Festival festival) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != festival.Id) { return(BadRequest()); } _dALFestival.UpdateFestival(festival); return(StatusCode(HttpStatusCode.NoContent)); }
private void UpdateFestivalExecute() { try { if (!string.IsNullOrEmpty(Festival.Name) && Place != null) { _currentFestival.Name = Festival.Name; _currentFestival.Date = DateTime.Parse(Date).ToString("dd/MM/yyyy"); _currentFestival.Place_Id = allPlaces.ElementAt(selectedPlace).Id; _dALFestival.UpdateFestival(_currentFestival); window.Close(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }