|
@@ -1,29 +1,17 @@
|
|
|
using CD67.FicheCollege.Entity;
|
|
using CD67.FicheCollege.Entity;
|
|
|
using System;
|
|
using System;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
|
|
+using System.Net;
|
|
|
using System.Web.Mvc;
|
|
using System.Web.Mvc;
|
|
|
|
|
|
|
|
namespace CD67.FicheCollege.MVC.Controllers
|
|
namespace CD67.FicheCollege.MVC.Controllers
|
|
|
{
|
|
{
|
|
|
public class HomeController : Controller
|
|
public class HomeController : Controller
|
|
|
{
|
|
{
|
|
|
- private Entities db = new Entities();
|
|
|
|
|
-
|
|
|
|
|
// GET: Home
|
|
// GET: Home
|
|
|
public ActionResult Index()
|
|
public ActionResult Index()
|
|
|
{
|
|
{
|
|
|
- string annee_lib;
|
|
|
|
|
-
|
|
|
|
|
- if (DateTime.Now.Month <= 6) {
|
|
|
|
|
- annee_lib = String.Format("{0}-{1}", DateTime.Now.Year - 1, DateTime.Now.Year);
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- annee_lib = String.Format("{0}-{1}", DateTime.Now.Year, DateTime.Now.Year + 1);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- int annee_id = db.Annees.Where(a => a.Libelle == annee_lib).First().Id;
|
|
|
|
|
-
|
|
|
|
|
- return RedirectToActionPermanent("Details", "Annees", new { id = annee_id });
|
|
|
|
|
|
|
+ return RedirectToAction("Details", "Annees", new { id = Annee.get_current_year_id() });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+}
|