|
|
@@ -18,29 +18,12 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
- // GET: ActionEduAxe/Details/5
|
|
|
- public ActionResult Details(int? id)
|
|
|
- {
|
|
|
- if (id == null)
|
|
|
- {
|
|
|
- return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
- }
|
|
|
- ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
|
|
|
- Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
|
|
|
- if (ActionEduAxe == null)
|
|
|
- {
|
|
|
- return HttpNotFound();
|
|
|
- }
|
|
|
- ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
|
|
|
- return View(model);
|
|
|
- }
|
|
|
-
|
|
|
// GET: ActionEduAxe/Create
|
|
|
public ActionResult Create()
|
|
|
{
|
|
|
- ActionEduAxe ActionEduAxe = new ActionEduAxe();
|
|
|
+ ActionEduAxe axe = new ActionEduAxe();
|
|
|
|
|
|
- ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
|
|
|
+ ActionEduAxeViewModel model = new ActionEduAxeViewModel(axe);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -49,16 +32,16 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
// plus de détails, voir http://go.microsoft.com/fwlink/?LinkId=317598.
|
|
|
[HttpPost]
|
|
|
[ValidateAntiForgeryToken]
|
|
|
- public ActionResult Create(ActionEduAxe ActionEduAxe)
|
|
|
+ public ActionResult Create(ActionEduAxe axe)
|
|
|
{
|
|
|
if (ModelState.IsValid)
|
|
|
{
|
|
|
ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
|
|
|
- ActionEduAxeFactory.add(ref ActionEduAxe);
|
|
|
+ ActionEduAxeFactory.add(ref axe);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
|
|
|
- ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
|
|
|
+ ActionEduAxeViewModel model = new ActionEduAxeViewModel(axe);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -69,13 +52,13 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
|
- ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
|
|
|
- Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
|
|
|
- if (ActionEduAxe == null)
|
|
|
+ ActionEduAxeFactory fact = new ActionEduAxeFactory(db);
|
|
|
+ ActionEduAxe axe = fact.getById(id.Value);
|
|
|
+ if (axe == null)
|
|
|
{
|
|
|
return HttpNotFound();
|
|
|
}
|
|
|
- ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
|
|
|
+ ActionEduAxeViewModel model = new ActionEduAxeViewModel(axe);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -84,15 +67,15 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
// plus de détails, voir http://go.microsoft.com/fwlink/?LinkId=317598.
|
|
|
[HttpPost]
|
|
|
[ValidateAntiForgeryToken]
|
|
|
- public ActionResult Edit(ActionEduAxe ActionEduAxe)
|
|
|
+ public ActionResult Edit(ActionEduAxe axe)
|
|
|
{
|
|
|
if (ModelState.IsValid)
|
|
|
{
|
|
|
- ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
|
|
|
- ActionEduAxeFactory.update(ref ActionEduAxe);
|
|
|
+ ActionEduAxeFactory fact = new ActionEduAxeFactory(db);
|
|
|
+ fact.update(ref axe);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
- ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
|
|
|
+ ActionEduAxeViewModel model = new ActionEduAxeViewModel(axe);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -103,13 +86,13 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
|
- ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
|
|
|
- Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
|
|
|
- if (ActionEduAxe == null)
|
|
|
+ ActionEduAxeFactory fact = new ActionEduAxeFactory(db);
|
|
|
+ ActionEduAxe axe = fact.getById(id.Value);
|
|
|
+ if (axe == null)
|
|
|
{
|
|
|
return HttpNotFound();
|
|
|
}
|
|
|
- ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
|
|
|
+ ActionEduAxeViewModel model = new ActionEduAxeViewModel(axe);
|
|
|
return View(model);
|
|
|
}
|
|
|
|
|
|
@@ -118,9 +101,9 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
[ValidateAntiForgeryToken]
|
|
|
public ActionResult DeleteConfirmed(int id)
|
|
|
{
|
|
|
- ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
|
|
|
- Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id);
|
|
|
- ActionEduAxeFactory.delete(ref ActionEduAxe);
|
|
|
+ ActionEduAxeFactory fact = new ActionEduAxeFactory(db);
|
|
|
+ ActionEduAxe axe = fact.getById(id);
|
|
|
+ fact.delete(ref axe);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
|
|
|
@@ -130,9 +113,9 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
|
- ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
|
|
|
- Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
|
|
|
- ActionEduAxeFactory.Up(ref ActionEduAxe);
|
|
|
+ ActionEduAxeFactory fact = new ActionEduAxeFactory(db);
|
|
|
+ ActionEduAxe axe = fact.getById(id.Value);
|
|
|
+ fact.Up(ref axe);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
|
|
|
@@ -142,9 +125,9 @@ namespace CD67.FicheCollege.MVC.Controllers
|
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
|
- ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
|
|
|
- Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
|
|
|
- ActionEduAxeFactory.Down(ref ActionEduAxe);
|
|
|
+ ActionEduAxeFactory fact = new ActionEduAxeFactory(db);
|
|
|
+ ActionEduAxe axe = fact.getById(id.Value);
|
|
|
+ fact.Down(ref axe);
|
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
|
|