//public IActionResult Index(string projectId) //{ // int id = Int32.Parse(projectId); // var currentProject = this.context.Projects.First(x => x.Id == id); // var data = new ApprovalProjectDisplay // ( // currentProject.Name, // currentProject.Description, // currentProject.StartDate, // currentProject.EndDate, // currentProject.Stage // ); // ViewBag.Id = projectId; // return View(data); //} public IActionResult Index(string projectId) { string UID = this.HttpContext.User.Identity.Name; if (UID != null) { var userProfile = this.context.Users.Find(UID); ViewBag.EmailAddress = userProfile.Uid; ViewBag.UsersName = userProfile.UserName; } else { ViewBag.EmailAddress = "*****@*****.**"; ViewBag.UsersName = "Sir What-the-Hack"; } int id = Int32.Parse(projectId); var currentProject = this.context.Projects.First(x => x.Id == id); var data = new ApprovalProjectDisplay ( currentProject.Name, currentProject.Description, currentProject.StartDate, currentProject.EndDate, currentProject.Stage ); ViewBag.Id = projectId; return(View(data)); }
public IActionResult Get(string projectId) { int id = Int32.Parse(projectId); var currentProject = this.context.Projects.First(x => x.Id == id); ViewData["Message"] = "Your application description page."; var data = new ApprovalProjectDisplay ( currentProject.Name, currentProject.Description, currentProject.StartDate, currentProject.EndDate, currentProject.Stage ); return(this.Json(data)); }