diff options
Diffstat (limited to 'Project-Unite/Controllers/ProfilesController.cs')
| -rw-r--r-- | Project-Unite/Controllers/ProfilesController.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Project-Unite/Controllers/ProfilesController.cs b/Project-Unite/Controllers/ProfilesController.cs index c77afda..a1d4235 100644 --- a/Project-Unite/Controllers/ProfilesController.cs +++ b/Project-Unite/Controllers/ProfilesController.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; +using Microsoft.AspNet.Identity; using Project_Unite.Models; namespace Project_Unite.Controllers @@ -25,5 +26,17 @@ namespace Project_Unite.Controllers return View(user); } + + public ActionResult PostContent(UserPost model) + { + var db = new ApplicationDbContext(); + model.Id = Guid.NewGuid().ToString(); + model.PostedAt = DateTime.Now; + model.UserId = User.Identity.GetUserId(); + db.UserPosts.Add(model); + db.SaveChanges(); + return RedirectToAction("ViewProfile", "Profiles", new { id = ACL.UserNameRaw(User.Identity.GetUserId()) }); + + } } }
\ No newline at end of file |
