// GET: Project/Details/5 public ActionResult Details(int id) { ProjectViewModel PVM = new ProjectViewModel(); var pip = ps.GetById(id); PVM.ProjectId = pip.ProjectId; PVM.ProjectName = pip.ProjectName; PVM.Start_Date = pip.Start_Date; PVM.End_Date = pip.End_Date; PVM.Duration = pip.Duration; PVM.etat = (Web.Models.Etat)pip.etat; //--------------------------------------- PVM.Description = pip.Description; var currentUserId = User.Identity.GetUserId(); int myInt = int.Parse(currentUserId); User teamlead = us.GetById(myInt); //--------------------------------------- TeamService teamservice = new TeamService(); Team t = teamservice.GetById(teamlead.TeamFK); //-------------------------------------------- float progress = TS.ProjectProgress(id); var T = TS.GetAll().Where(e => e.ProjectFK == id); Console.WriteLine(T); List <Tasks> tasks = T.ToList(); ViewData["Tasks"] = tasks; ViewData["TeamLead"] = teamlead; ViewData["Team"] = t; ViewData["Progress"] = progress; return(View(PVM)); }