From 0f2629f0603b3c8f5dddf0747da6916dbf479dc4 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 23 Mar 2017 18:08:20 -0400 Subject: Profile work. --- Project-Unite/Controllers/ProfilesController.cs | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Project-Unite/Controllers/ProfilesController.cs (limited to 'Project-Unite/Controllers/ProfilesController.cs') diff --git a/Project-Unite/Controllers/ProfilesController.cs b/Project-Unite/Controllers/ProfilesController.cs new file mode 100644 index 0000000..c77afda --- /dev/null +++ b/Project-Unite/Controllers/ProfilesController.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Project_Unite.Models; + +namespace Project_Unite.Controllers +{ + [Authorize] + public class ProfilesController : Controller + { + // GET: Profiles + public ActionResult Index() + { + return View(); + } + + public ActionResult ViewProfile(string id) + { + var db = new ApplicationDbContext(); + var user = db.Users.FirstOrDefault(x => x.DisplayName == id); + if (user == null) + return new HttpStatusCodeResult(404); + + return View(user); + } + } +} \ No newline at end of file -- cgit v1.2.3