// GET: Purchases public ActionResult GetPurchaseHistory(string sessionId) { sessionId = (string)Session["sessionid"]; List <Purchase> purchases = PurchaseData.GetPurchaseHistoryBy(sessionId); //ViewData["cartId"] = cartId; ViewData["purchases"] = purchases; //ViewData["results"] = results; if (sessionId != null) { return(View()); } else { return(RedirectToAction("Index", "Login")); } }