public ActionResult Index()
 {
     List<Customer> customerList = new List<Customer>();
     ViewBag.isLoggedIn = false;
     LoginViewModel login = new LoginViewModel();
     return View(login);
 }
        public ActionResult Index(LoginViewModel login)
        {
            ViewBag.Message = "This log in didn't break anything.";

            ViewBag.isLoggedIn = false;

            var q = from c in db.users
                    where login.Username == c.UserName
                    select c;
            q = q.Where(u => u.UserName.Equals(login.Username));

            int count = q.Count(u => u.UserName == u.UserName);

            if (count == 1 && q.First().Password == login.Password)
            {
                Customer customer = (from c in q
                                     select c).First();
                ViewBag.isLoggedIn = true;
                ViewBag.Username = customer.UserName;
                ViewBag.Name = customer.Name;
                ViewBag.carID = customer.carID;
            }
            return View();
        }