コード例 #1
0
        //
        // GET: /EventDetailAdmin/
        public ActionResult Index(string eventId)
        {
            if (string.IsNullOrEmpty(eventId))
            {
                return(Redirect("/"));
            }

            int  eventIdInt;
            bool isNumeric = int.TryParse(eventId, out eventIdInt);

            if (!isNumeric)
            {
                return(Redirect("/"));
            }

            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;

                if (!(bool)theUser["can_examine_salesDetails"])
                {
                    return(Redirect("/"));
                }
            }
            else
            {
                return(Redirect("/"));
            }


            Dictionary <string, Object> theEvent = EventDetailModel.getEventInfo(eventIdInt);

            ViewBag.theEvent = theEvent;
            Dictionary <string, List <Object> > ticketInfos = EventDetailModel.getEventTicketInfo(eventIdInt);

            ViewBag.ticketInfos = ticketInfos;


            return(View());
        }
コード例 #2
0
        //
        // 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());
        }