public ActionResult UserLogin(string username, string password) { if (SQLProcedures.CheckLoginCredentials(username, password)) { Session["username"] = username; return(RedirectToAction("Index", "MainPage")); } else { ViewBag.ErrorMessage = true; return(View()); } }