Example #1
0
 public JsonResult RemoveCourseFromPlan(string planName, int id)
 {
     try
     {
         _repository.RemoveCourse(id, planName, User.Identity.Name);
         if (_repository.SaveAll())
         {
             Response.StatusCode = (int)HttpStatusCode.Accepted;
             return(Json("course removed"));
         }
     }
     catch (Exception ex)
     {
         _logger.LogError("Failed to remove course", ex);
         return(Json("Failed to remove course"));
     }
     return(Json("Failed to remove course. Cannot find course"));
 }