コード例 #1
0
 private void DeleteFestivalExecute()
 {
     try
     {
         _dALFestival.DeleteFestival(Festival.Id);
         Festivals = _dALFestival.AllFestivals();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
コード例 #2
0
        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));
        }