public ActionResult Login(string Id_Number, string Password) { if (UserAction.CheckLogin(Id_Number, Password) != null) { var user = UserAction.Find(Id_Number); Session["id"] = user.id_number; Session["role"] = user.role; Session["name"] = user.sub_name + " " + user.name; Session.Timeout = 24; return(Redirect("~/Home/Index")); } else { return(Redirect("~/")); } }