public ActionResult Index() { Etouches consume = new Etouches(); //initiate list of events List <AllEvents> eventsList = JsonConvert.DeserializeObject <List <AllEvents> >(consume.ListEvents(getKey)); ViewBag.list = eventsList; return(View()); }
// GET: Events public ActionResult Papercon() { Etouches consume = new Etouches(); // event id, assigned by eTouches String eventId = "97742"; // call GetEvent(id, token) in Etouched model, // returns parsed JSON of full event details var eventDetails = consume.GetEvent(eventId, getKey); var listQuestions = consume.GetQuestions(eventId, getKey); List <QuestionsList> questionList = JsonConvert.DeserializeObject <List <QuestionsList> >(listQuestions); ViewBag.questions = questionList; ViewBag.test = eventDetails.name; ViewBag.test1 = eventDetails.code; ViewBag.dates = eventDetails.startdate + " to " + eventDetails.enddate; return(View()); }