public ActionResult AddUser(GetaJob_User user) { db.GetaJob_User.Add(user); db.SaveChanges(); (new LoginController()).SetCookie(user.UserName); return RedirectToAction("Index", "Home"); }
public ActionResult Login(GetaJob_User person) { var possiblePerson = db.GetaJob_User.Where(p => p.UserId == person.UserId && p.Password == person.Password).FirstOrDefault(); if (possiblePerson != null) { SetCookie(possiblePerson.UserName ); return RedirectToAction("Index", "Home"); } else { ViewBag.ErrorMessage = "userId not found"; } return View(); }
public ActionResult UpdateUser(GetaJob_User changes) { var oldUserId = Session["olduserId"].ToString(); GetaJob_User current = db.GetaJob_User.Where(c => c.UserId == oldUserId).First(); current.UserId = changes.UserId; current.FirstName = changes.FirstName; current.LastName = changes.LastName; current.UserName = changes.UserName; current.UserId = changes.UserId; current.Password = changes.Password; current.CurrentJobSearchId = changes.CurrentJobSearchId; current.dob = changes.dob; db.SaveChanges(); SetCookie(current.UserName); return RedirectToAction("Index", "Home"); }