| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using System.Web.Mvc;
- using System.Net;
- using CD67.FicheCollege.Factory;
- using CD67.FicheCollege.Entity;
- using CD67.FicheCollege.MVC.Models;
- using System.Collections.Generic;
- namespace CD67.FicheCollege.MVC.Controllers
- {
- public class AnneesController : Controller
- {
- private Entities db = new Entities();
- // GET: Annees
- public ActionResult Index()
- {
- AnneeFactory fact = new AnneeFactory(db);
- AnneeIndexViewModel model = new AnneeIndexViewModel(fact.getAll());
- return View(model);
- }
- // GET: Home
- public ActionResult Details(int? id)
- {
- if (id == null)
- {
- return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
- }
- AnneeFactory anneeFactory = new AnneeFactory(db);
- Entity.Annee annee = anneeFactory.getById(id);
- if (annee == null)
- {
- return HttpNotFound();
- }
- AnneeViewModel model = new AnneeViewModel(annee, db);
- return View(model);
- }
- public ActionResult Previous(int? id)
- {
- if (id == null)
- {
- return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
- }
- AnneeFactory anneeFactory = new AnneeFactory(db);
- Entity.Annee annee = anneeFactory.getById(id);
- if (annee == null)
- {
- return HttpNotFound();
- }
- AnneeViewModel model = new AnneeViewModel(annee, db);
- return View(model);
- }
- public ActionResult Next(int? id)
- {
- if (id == null)
- {
- return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
- }
- AnneeFactory anneeFactory = new AnneeFactory(db);
- Entity.Annee annee = anneeFactory.getById(id);
- if (annee == null)
- {
- return HttpNotFound();
- }
- AnneeViewModel model = new AnneeViewModel(annee, db);
- return View(model);
- }
- }
- }
|