public ActionResult Rename(int id, PlaygroundName pgn) { Course course = _GetCourse(); if (course == null) { return(RedirectToAction("SelectCourse")); } var repo = PlaygroundRepository.Get(course.CourseId, User.GetName(), id, false); if (repo == null) { return(new HttpNotFoundResult()); } try { repo.SetName(pgn.Name); return(RedirectToAction("Index")); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); } }
public ActionResult Create(PlaygroundName pgn) { Course course = _GetCourse(); if (course == null) { return(RedirectToAction("SelectCourse")); } try { var repo = PlaygroundRepository.Create(course.CourseId, User.GetName(), pgn.Name); return(RedirectToAction("Edit", new { id = repo.RepositoryId })); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); } }