public ActionResult Register(user2 e) { DBCTX DC = new DBCTX(); DC.user.Add(e); DC.SaveChanges(); return(RedirectToAction("login")); }
public ActionResult login(user2 L, string ReturnUrl = "") { using (DBCTX DC1 = new DBCTX()) { var user = DC1.user.Where(a => a.uid.Equals(L.uid) && a.pass.Equals(L.pass)).FirstOrDefault(); if (user != null) { FormsAuthentication.SetAuthCookie(user.fname, false); if (Url.IsLocalUrl(ReturnUrl)) { return(Redirect(ReturnUrl)); } else { return(RedirectToAction("AfterLogin", "Home")); } } } return(View()); }