public ActionResult Login(Customer cust) { if (ModelState.IsValid) { using (VintageDBEntities7 dc = new VintageDBEntities7()) { var v = dc.Customers.Where(model => model.Email.Equals(cust.Email) && model.Password.Equals(cust.Password)).FirstOrDefault(); if (v != null) { Session["LoginCustomerID"] = v.Email.ToString(); Session["LoginCustomerName"] = v.Name.ToString(); Session["LoggedCustomerID"] = v.Id.ToString(); if (Session["LoginBuyID"] == null) { return(RedirectToAction("Index", "Home")); } else { Session["shopnow"] = v.Name; return(RedirectToAction("Details", "Cars", new { id = Session["LoginBuyID"] })); } } } } return(View(cust)); }