예제 #1
0
 public ActionResult Index()
 {
     if (Request.Cookies[cookie_name] != null)
     {
         if (funcion.valid_cookie(Request.Cookies[cookie_name].Value))
         {
             ViewBag.usuario = funcion.get_username_in_cookie(Request.Cookies[cookie_name].Value);
             if (TempData["mensaje"] != null)
             {
                 ViewBag.mensaje = TempData["mensaje"].ToString();
             }
             ViewBag.cantidad_productos = productoBL.List("").Count();
             return(View("Listar", productoBL.List("")));
         }
         else
         {
             return(RedirectToAction("Index", "Login"));
         }
     }
     else
     {
         return(RedirectToAction("Index", "Login"));
     }
 }