Beispiel #1
0
 public DeletePostureChallengeResponse DeletePostureChallenge(DeletePostureChallengeRequest request)
 {
     try
     {
         var postureChallenge = new PostureChallenge {
             Id = request.Id
         };
         DataContext.PostureChalleges.Attach(postureChallenge);
         DataContext.PostureChalleges.Remove(postureChallenge);
         DataContext.SaveChanges();
         return(new DeletePostureChallengeResponse
         {
             IsSuccess = true,
             Message = "The item has been deleted successfully",
         });
     }
     catch
     {
         return(new DeletePostureChallengeResponse
         {
             IsSuccess = false,
             Message = "An error occured, please contact the administrator for further information"
         });
     }
 }
Beispiel #2
0
 public ActionResult DeletePostureChallenge(int id)
 {
     var request = new DeletePostureChallengeRequest { Id = id };
     return Json(_businessPostureService.DeletePostureChallenge(request));
 }