public ActionResult ProfileView() { try { if (Session["DevId"] != null) { DeveloperDAO dao = new DeveloperDAO(); ApplicationDAO appdao = new ApplicationDAO(); UserDAO udao = new UserDAO(); CountryDAO cdao = new CountryDAO(); Developer dev = dao.SearchById(int.Parse(Session["DevId"].ToString())); User u = udao.SearchById(int.Parse(Session["Id"].ToString())); CartDAO cardao = new CartDAO(); if (Session["Id"] != null) { ViewBag.Cart = cardao.SearchCartUser(int.Parse(Session["Id"].ToString())); } ViewBag.DevGames = appdao.GetDevGames(dev.Id); ViewBag.Dev = dev; ViewBag.User = u; ViewBag.CountryUser = cdao.SearchById(u.CountryId); return(View()); } else { return(RedirectToAction("../Home/Index")); } } catch { return(RedirectToAction("Index", "Home")); } }
public ActionResult YourReviews() { try { if (Session["DevId"] != null) { ApplicationDAO appdao = new ApplicationDAO(); ReviewDAO rdao = new ReviewDAO(); IList <Application> apps = appdao.GetDevGames(int.Parse(Session["DevId"].ToString())); UserDAO udao = new UserDAO(); ViewBag.User = udao.SearchById(int.Parse(Session["Id"].ToString())); //IList<Review> revs = new List<Review>(); //foreach (var a in apps) //{ // IList<Review> rev = rdao.SearchByAppId(a.Id); // foreach(var r in rev) // { // revs.Add(r); // } //} ViewBag.Apps = apps; return(View()); } return(RedirectToAction("Index", "Home")); } catch { return(RedirectToAction("Index", "Home")); } }
public ActionResult Summary() { try { if (Session["DevId"] != null) { DeveloperDAO dao = new DeveloperDAO(); UserDAO udao = new UserDAO(); ApplicationDAO adao = new ApplicationDAO(); ViewBag.User = udao.SearchById(int.Parse(Session["Id"].ToString())); Developer d = dao.SearchById(int.Parse(Session["DevId"].ToString())); ViewBag.Apps = adao.GetDevGames(d.Id); ViewBag.Dev = d; return(View()); } return(RedirectToAction("Index", "Home")); } catch { return(RedirectToAction("Index", "Home")); } }