// // GET: /UserProfile/ public ActionResult Index() { if ((Session["KardoUserId"] != null && Session["KardoUserName"] != null)) { int userId = Convert.ToInt32(UseKardoEncryption.getDecipherString(Session["KardoUserId"].ToString())); Dictionary <string, Object> theUser = DefaultModel.getUserFromUserId(userId); ViewBag.userInfos = theUser; ViewBag.userTickets = UserProfileModel.getUserTickets((int)theUser["userId"]); } else { return(Redirect("/")); } return(View()); }
// // GET: /EventDetail/ public ActionResult Index(string eventId) { if (string.IsNullOrEmpty(eventId)) { return(Redirect("/")); } string eventIdStr = UseKardoEncryption.getDecipherString(eventId); if (eventIdStr == "KardoEncryptionError") { return(Redirect("/")); } int eventIdInt; bool isNumeric = int.TryParse(eventIdStr, out eventIdInt); if (!isNumeric) { return(Redirect("/")); } Dictionary <string, Object> theEvent = EventDetailModel.getEventInfo(eventIdInt); Dictionary <string, List <Object> > ticketInfos = EventDetailModel.getEventTicketInfo(eventIdInt); ViewBag.theEvent = theEvent; ViewBag.ticketInfos = ticketInfos; if ((Session["KardoUserId"] != null && Session["KardoUserName"] != null)) { int userId = Convert.ToInt32(UseKardoEncryption.getDecipherString(Session["KardoUserId"].ToString())); Dictionary <string, Object> theUser = DefaultModel.getUserFromUserId(userId); ViewBag.userInfos = theUser; ViewBag.userTickets = UserProfileModel.getUserTickets((int)theUser["userId"]); } return(View()); }