public ActionResult Update(int idPoint = 0) { PointModel point = MgtPoint.GetInstance().GetPointById(idPoint).ToModel(); point.ListTypePointOptions = MgtTypePoint.GetInstance().GetAllItems(); point.ListCourseOptions = MgtRace.GetInstance().GetAllItems(); return(View(point)); }
public ActionResult Create(int id = 0) { PointModel point = new PointModel(); point.ListTypePointOptions = MgtTypePoint.GetInstance().GetAllItems(); point.IdCourse = id; point.Ordre = MgtPoint.GetInstance().GetAllWithCourseAndTypePointByCourse(id).Count; return(View(point)); }
public ActionResult Edit(int id = 0) { var result = MgtTypePoint.GetInstance().GetTypePoint(id).ToModel(); if (result == null) { return(HttpNotFound()); } return(View(result)); }
public ActionResult Delete(int idPoint) { var result = MgtPoint.GetInstance().GetPointById(idPoint).ToModel(); RaceModel race = MgtRace.GetInstance().GetRace(result.IdCourse).ToModel(); TypePointModel typePoint = MgtTypePoint.GetInstance().GetTypePoint(result.IdTypePoint).ToModel(); result.LibelleCourse = race.Title; result.LibelleTypePoint = typePoint.Libelle; if (result == null) { return(HttpNotFound()); } return(View(result)); }
public ActionResult Create(TypePointModel typePoint) { try { if (ModelState.IsValid && MgtTypePoint.GetInstance().AddTypePoint(typePoint.ToBo())) { return(RedirectToAction("Index")); } else { return(View()); } } catch { return(View()); } }
public ActionResult Edit(TypePointModel typePoint) { try { var result = MgtTypePoint.GetInstance().UpdateTypePoint(typePoint.ToBo()); if (result) { return(RedirectToAction("Index")); } else { return(View()); } } catch { return(View()); } }
public ActionResult Create(PointModel point) { try { if (ModelState.IsValid && MgtPoint.GetInstance().AddPoint(point.ToBo())) { return(RedirectToAction("Index", new { id = point.IdCourse })); } else { point.ListTypePointOptions = MgtTypePoint.GetInstance().GetAllItems(); return(View(point)); } } catch { point.ListTypePointOptions = MgtTypePoint.GetInstance().GetAllItems(); return(View(point)); } }
public ActionResult Index() { List <TypePointModel> result = MgtTypePoint.GetInstance().GetAllItems().ToModels(); return(View(result)); }