public ActionResult ShopTokens(ShopTokensModel model) { if (model.NumTokens == 0) { ViewBag.ErrorMessage = "Choose one of three token packages"; return(View()); } TempData["ShopTokenInfo"] = new ShopTokensModel(model.Currency, model.NumTokens); return(Redirect("PurchaseTokens")); }
public ActionResult PurchaseTokens() { var db = new auctiondbEntities(); var user = db.AspNetUsers.Find(User.Identity.GetUserId()); ShopTokensModel shopTokenInfo = TempData["ShopTokenInfo"] as ShopTokensModel; PurchaseTokensModel model = new PurchaseTokensModel() { Currency = shopTokenInfo.Currency, NumTokens = shopTokenInfo.NumTokens, FirstName = user.FirstName, LastName = user.LastName, TotalPrice = shopTokenInfo.NumTokens * SystemParameters.TOKEN_VALUE }; TempData["PurchaseTokensModel"] = model; return(View(model)); }