X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=Projects%2FControllers%2FHomeController.cs;h=a55e6d23f575c923c252c1642ca5b0471f2fe9ed;hb=f03e98751aea4094a7ee81ea7c59b03ab684080a;hp=c5d394a44686af0865849f1c343c3a01b181f012;hpb=8881855dd17d8b81466b8b646fd17d51a34697d7;p=wsti_pai.git diff --git a/Projects/Controllers/HomeController.cs b/Projects/Controllers/HomeController.cs index c5d394a..a55e6d2 100644 --- a/Projects/Controllers/HomeController.cs +++ b/Projects/Controllers/HomeController.cs @@ -3,13 +3,28 @@ using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; +using Projects.Models; namespace Projects.Controllers { public class HomeController : Controller { + private ProjectsDBEntities db = new ProjectsDBEntities(); + public ActionResult Index() { + Project recentProject = (from d in db.Projects + orderby d.updated_at descending + select d) + .FirstOrDefault(); + ProjectTask recentTask = (from d in db.ProjectTasks + orderby d.updated_at descending + select d) + .FirstOrDefault(); + + ViewBag.recentProject = recentProject; + ViewBag.recentTask = recentTask; + return View(); }