X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=Projects%2FControllers%2FHomeController.cs;h=a55e6d23f575c923c252c1642ca5b0471f2fe9ed;hb=f03e98751aea4094a7ee81ea7c59b03ab684080a;hp=3f1f379839427ecf36ec15a21364e6310fbbd059;hpb=5e0fe0cb10f848f46dd875350ca51198e28e0c74;p=wsti_pai.git diff --git a/Projects/Controllers/HomeController.cs b/Projects/Controllers/HomeController.cs index 3f1f379..a55e6d2 100644 --- a/Projects/Controllers/HomeController.cs +++ b/Projects/Controllers/HomeController.cs @@ -3,20 +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 { - public ActionResult Index() - { - return View(); - } + private ProjectsDBEntities db = new ProjectsDBEntities(); - public ActionResult About() + public ActionResult Index() { - ViewBag.Message = "Your application description page."; + 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(); }