public ActionResult LoginIndex(T_Admin t_Admin) { QueryCRUD query = new QueryCRUD(); bool chk = query.CheckLogin(t_Admin.User_name, t_Admin.Password); List <T_Admin> listTic = new List <T_Admin>(); QueryCRUD qr = new QueryCRUD(); listTic = qr.T_Admins(t_Admin.User_name, t_Admin.Password); if (chk == true) { TempData["User_name"] = t_Admin.User_name; Session["User_name"] = t_Admin.User_name; Session["Type"] = listTic; return(RedirectToAction("Index", "Show")); } else { TempData["message"] = "User And Password Invalid"; return(View()); } }