Пример #1
0
 private void DeleteAwardExecute()
 {
     try
     {
         _dALAward.DeleteAward(Award.Id);
         Awards = _dALAward.AllAwards();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Пример #2
0
        public IHttpActionResult DeleteAward(int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Award award = _dALAward.GetAwardById(id);

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

            award.Deleted = true;
            _dALAward.DeleteAward(award.Id);

            return(StatusCode(HttpStatusCode.NoContent));
        }