コード例 #1
0
 public ActionResult Logout()
 {
     try
     {
         AccountBusiness ab = new AccountBusiness();
         if (Session["CusUserId"] != null)
         {
             MvcApplication.changeStatusNotifer.Dispose();
             ab.SetLogoutTime((int)Session["UserId"]);
         }
         if (Session["UserRole"] != null)
         {
             if ((int)Session["UserRole"] == 2)
             {
                 ab.SetLogoutTime((int)Session["UserId"]);
             }
         }
         Session["User"] = null;
         Session["BeEdited"] = null;
         Session.Clear();
         return RedirectToAction("Index", "Home");
     }
     catch
     {
         return RedirectToAction("Index", "Error");
     }
 }