Example #1
0
 private void UpdateGenreExecute()
 {
     try
     {
         if (!string.IsNullOrEmpty(Genre.Name))
         {
             _dALHelper.UpdateGenre(_genre);
             zanrWindow.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
        public IHttpActionResult PutGenre(int id, Genre genre)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != genre.Id)
            {
                return(BadRequest());
            }

            _dALGenre.UpdateGenre(genre);

            return(StatusCode(HttpStatusCode.NoContent));
        }