dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
wsti_pai.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Home view
[wsti_pai.git]
/
Projects
/
Controllers
/
HomeController.cs
diff --git
a/Projects/Controllers/HomeController.cs
b/Projects/Controllers/HomeController.cs
index 3f1f379839427ecf36ec15a21364e6310fbbd059..a55e6d23f575c923c252c1642ca5b0471f2fe9ed 100644
(file)
--- 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 System.Linq;
using System.Web;
using System.Web.Mvc;
+using Projects.Models;
namespace Projects.Controllers
{
public class HomeController : Controller
{
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();
}
return View();
}