|
|
@@ -18,28 +18,11 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
- // GET: ActionEduThematique/Details/5
|
|
|
- public ActionResult Details(int? id)
|
|
|
- {
|
|
|
- if (id == null)
|
|
|
- {
|
|
|
- return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
- }
|
|
|
- ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
|
|
|
- Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
|
|
|
- if (ActionEduThematique == null)
|
|
|
- {
|
|
|
- return HttpNotFound();
|
|
|
- }
|
|
|
- ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
|
|
|
- return View(model);
|
|
|
- }
|
|
|
-
|
|
|
// GET: ActionEduThematique/Create
|
|
|
public ActionResult Create()
|
|
|
{
|
|
|
- Entity.ActionEduThematique ActionEduThematique = new Entity.ActionEduThematique();
|
|
|
- ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
|
|
|
+ ActionEduThematique thematique = new ActionEduThematique();
|
|
|
+ ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(thematique, db, ModeAcces.Creation);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -48,16 +31,16 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
// plus de détails, voir http://go.microsoft.com/fwlink/?LinkId=317598.
|
|
|
[HttpPost]
|
|
|
[ValidateAntiForgeryToken]
|
|
|
- public ActionResult Create(ActionEduThematique ActionEduThematique)
|
|
|
+ public ActionResult Create(ActionEduThematique thematique)
|
|
|
{
|
|
|
if (ModelState.IsValid)
|
|
|
{
|
|
|
- ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
|
|
|
- ActionEduThematiqueFactory.add(ref ActionEduThematique);
|
|
|
+ ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(db);
|
|
|
+ fact.add(ref thematique);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
|
|
|
- ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
|
|
|
+ ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(thematique, db, ModeAcces.Creation);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -68,13 +51,13 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
|
- ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
|
|
|
- Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
|
|
|
- if (ActionEduThematique == null)
|
|
|
+ ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(db);
|
|
|
+ Entity.ActionEduThematique thematique = fact.getById(id.Value);
|
|
|
+ if (thematique == null)
|
|
|
{
|
|
|
return HttpNotFound();
|
|
|
}
|
|
|
- ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
|
|
|
+ ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(thematique, db, ModeAcces.Modification);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -83,15 +66,15 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
// plus de détails, voir http://go.microsoft.com/fwlink/?LinkId=317598.
|
|
|
[HttpPost]
|
|
|
[ValidateAntiForgeryToken]
|
|
|
- public ActionResult Edit(ActionEduThematique ActionEduThematique)
|
|
|
+ public ActionResult Edit(ActionEduThematique thematique)
|
|
|
{
|
|
|
if (ModelState.IsValid)
|
|
|
{
|
|
|
- ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
|
|
|
- ActionEduThematiqueFactory.update(ref ActionEduThematique);
|
|
|
+ ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(db);
|
|
|
+ fact.update(ref thematique);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
- ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
|
|
|
+ ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(thematique, db, ModeAcces.Modification);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -102,13 +85,13 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
|
- ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
|
|
|
- Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
|
|
|
- if (ActionEduThematique == null)
|
|
|
+ ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(db);
|
|
|
+ Entity.ActionEduThematique thematique = fact.getById(id.Value);
|
|
|
+ if (thematique == null)
|
|
|
{
|
|
|
return HttpNotFound();
|
|
|
}
|
|
|
- ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
|
|
|
+ ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(thematique, db);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -117,9 +100,9 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
[ValidateAntiForgeryToken]
|
|
|
public ActionResult DeleteConfirmed(int id)
|
|
|
{
|
|
|
- ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
|
|
|
- Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id);
|
|
|
- ActionEduThematiqueFactory.delete(ref ActionEduThematique);
|
|
|
+ ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(db);
|
|
|
+ Entity.ActionEduThematique thematique = fact.getById(id);
|
|
|
+ fact.delete(ref thematique);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
|
|
|
@@ -129,9 +112,9 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
|
- ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
|
|
|
- Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
|
|
|
- ActionEduThematiqueFactory.Up(ref ActionEduThematique);
|
|
|
+ ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(db);
|
|
|
+ Entity.ActionEduThematique thematique = fact.getById(id.Value);
|
|
|
+ fact.Up(ref thematique);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
|
|
|
@@ -141,9 +124,9 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
|
- ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
|
|
|
- Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
|
|
|
- ActionEduThematiqueFactory.Down(ref ActionEduThematique);
|
|
|
+ ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(db);
|
|
|
+ Entity.ActionEduThematique thematique = fact.getById(id.Value);
|
|
|
+ fact.Down(ref thematique);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
|