summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers/ManageController.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-25 15:14:27 -0400
committerMichael <[email protected]>2017-03-25 15:14:27 -0400
commit84285d2ffb84f470ab7b09708075427ae31541f0 (patch)
treeb95905e1ce7bc3cf2ac373cbeb7a0bbfe1ee07e1 /Project-Unite/Controllers/ManageController.cs
parent7fced3d987f81bb547044a3823f67f6138977edb (diff)
downloadproject-unite-84285d2ffb84f470ab7b09708075427ae31541f0.tar.gz
project-unite-84285d2ffb84f470ab7b09708075427ae31541f0.tar.bz2
project-unite-84285d2ffb84f470ab7b09708075427ae31541f0.zip
Minimal profile editing.
Diffstat (limited to 'Project-Unite/Controllers/ManageController.cs')
-rw-r--r--Project-Unite/Controllers/ManageController.cs72
1 files changed, 72 insertions, 0 deletions
diff --git a/Project-Unite/Controllers/ManageController.cs b/Project-Unite/Controllers/ManageController.cs
index 5c3a3e7..4543307 100644
--- a/Project-Unite/Controllers/ManageController.cs
+++ b/Project-Unite/Controllers/ManageController.cs
@@ -237,6 +237,78 @@ namespace Project_Unite.Controllers
return View(model);
}
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ public ActionResult ChangeFullName(ApplicationUser model)
+ {
+ var db = new ApplicationDbContext();
+ var usr = db.Users.FirstOrDefault(x => x.UserName == User.Identity.Name);
+ usr.FullName = model.FullName;
+ db.SaveChanges();
+ return RedirectToAction("Index");
+ }
+
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ public ActionResult ChangeBio(ApplicationUser model)
+ {
+ var db = new ApplicationDbContext();
+ var usr = db.Users.FirstOrDefault(x => x.UserName == User.Identity.Name);
+ usr.Bio = model.Bio;
+ db.SaveChanges();
+ return RedirectToAction("Index");
+ }
+
+
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ public ActionResult ChangeInterests(ApplicationUser model)
+ {
+ var db = new ApplicationDbContext();
+ var usr = db.Users.FirstOrDefault(x => x.UserName == User.Identity.Name);
+ usr.Interests = model.Interests;
+ db.SaveChanges();
+ return RedirectToAction("Index");
+ }
+
+
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ public ActionResult ChangeHobbies(ApplicationUser model)
+ {
+ var db = new ApplicationDbContext();
+ var usr = db.Users.FirstOrDefault(x => x.UserName == User.Identity.Name);
+ usr.Hobbies = model.Hobbies;
+ db.SaveChanges();
+ return RedirectToAction("Index");
+ }
+
+
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ public ActionResult ChangeYouTube(ApplicationUser model)
+ {
+ var db = new ApplicationDbContext();
+ var usr = db.Users.FirstOrDefault(x => x.UserName == User.Identity.Name);
+ usr.YoutubeUrl = model.YoutubeUrl;
+ db.SaveChanges();
+ return RedirectToAction("Index");
+ }
+
+
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ public ActionResult ChangeWebsite(ApplicationUser model)
+ {
+ var db = new ApplicationDbContext();
+ var usr = db.Users.FirstOrDefault(x => x.UserName == User.Identity.Name);
+ usr.Website = model.Website;
+ db.SaveChanges();
+ return RedirectToAction("Index");
+ }
+
+
+
//
// GET: /Manage/SetPassword
public ActionResult SetPassword()