public async Task <ActionResult> AjaxAdd(int courseId) { if (courseId == 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var result = await CatalogManager.AddCourseToLearningPlanAsync(UserId, courseId); return(result.Succeeded ? new HttpStatusCodeResult(HttpStatusCode.NoContent) : new HttpStatusCodeResult(HttpStatusCode.BadRequest, result.Errors.First())); }
public async Task <ActionResult> Add(int courseId) { if (courseId == 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } await CatalogManager.AddCourseToLearningPlanAsync(UserId, courseId); var courseRouteParam = await CatalogManager.GetCourseRouteParamAsync(courseId); return(RedirectToRoute(AppConstants.RouteNames.Course, courseRouteParam)); }