Exemplo n.º 1
0
 public ActionResult Library()
 {
     try
     {
         if (Session["Id"] != null)
         {
             CartDAO          cardao = new CartDAO();
             SellItemDAO      sidao  = new SellItemDAO();
             SellDAO          sdao   = new SellDAO();
             ApplicationDAO   appdao = new ApplicationDAO();
             IList <SellItem> si     = sidao.GetUserApps(int.Parse(Session["Id"].ToString()));
             ViewBag.UserApps  = si;
             ViewBag.AppsinLib = appdao.GetAppsInLibrary(si);
             ViewBag.Sells     = sdao.GetUserSells(int.Parse(Session["Id"].ToString()));
             ViewBag.Cart      = cardao.SearchCartUser(int.Parse(Session["Id"].ToString()));
             return(View());
         }
         return(RedirectToAction("../Home/Index"));
     }
     catch
     {
         return(RedirectToAction("Index", "Home"));
     }
 }