public ActionResult SignUp(Membership1 m) { if (ModelState.IsValid) { TaskService.insertmembers(m); return(RedirectToAction("Index")); } return(View()); }
public ActionResult SignUp(Membership1 model) { using (var context = new EmployeeDBEntities()) { User mem = new User { UserName = model.UserName, Password = model.Password }; context.User.Add(mem); context.SaveChanges(); } return(RedirectToAction("Login")); }
public ActionResult Login(Membership1 model) { using (var context = new EmployeeDBEntities()) { bool isValid = context.User.Any(x => x.UserName == model.UserName && x.Password == model.Password); if (isValid) { FormsAuthentication.SetAuthCookie(model.UserName, false); return(RedirectToAction("GetAllRecords", "Home")); } else { ViewBag.Error = "Incorrect username or Password"; } } return(View()); }
public void insermembers(Membership1 u) { userdb.memberships.Add(u); userdb.SaveChanges(); }
public static void insertmembers(Membership1 m) { taskdb.insermembers(m); }