ActionsEduCollegeController.cs 829 B

123456789101112131415161718192021222324252627282930
  1. using CD67.FicheCollege.Entity;
  2. using CD67.FicheCollege.Factory;
  3. using CD67.FicheCollege.MVC.Models;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Net;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace CD67.FicheCollege.MVC.Controllers
  10. {
  11. public class ActionsEduCollegeController : Controller
  12. {
  13. private Entities db = new Entities();
  14. // GET: Actions
  15. public ActionResult Index(int? annee_id)
  16. {
  17. if (annee_id == null)
  18. {
  19. return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
  20. }
  21. AnneeFactory fact = new AnneeFactory(db);
  22. Annee annee = fact.getById(annee_id);
  23. AnneeViewModel model = new AnneeViewModel(annee, ModeAcces.Lecture);
  24. return View(model);
  25. }
  26. }
  27. }