public ActionResult signup(SOUND_SYSTEM.Model.userdata p) { userdata si = mdi.userdatas.Where(x => x.Username == p.Username).SingleOrDefault(); if (si == null) { mdi.userdatas.Add(p); mdi.SaveChanges(); Session["uname"] = p.Username; return(Redirect("/Home/Index")); } else { ViewBag.Error = "Username Already Exists ......"; return(View("signup")); } }
public ActionResult Validatesignin(SOUND_SYSTEM.Model.userdata p) { userdata si = mdi.userdatas.Where(x => x.Email == p.Email).SingleOrDefault(); if (si != null) { if ((si.Email == p.Email) && (si.Password == p.Password)) { Session["uname"] = p.Username; return(Redirect("/Admin/Index")); } else { ViewBag.Error = " Incorrect Username and Password"; return(View("login")); } } else { ViewBag.Error = " Incorrect Username and Password"; } return(View("login")); }