Example #1
0
 private void DeleteActorExecute()
 {
     try
     {
         Actor.Deleted = true;
         _dALActor.DeleteActor(Actor.Id);
         Actors = _dALActor.AllActors();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Example #2
0
        public IHttpActionResult DeleteActor(int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Actor actor = _dALActor.GetActorById(id);

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

            actor.Deleted = true;
            _dALActor.DeleteActor(actor.Id);

            return(StatusCode(HttpStatusCode.NoContent));
        }