public ActionResult Preview(string id, int announcementApplicationId) { var storage = new Storage(); storage.Set(announcementApplicationId.ToString(), id); var connector = new YoutubeConnector(); var video = connector.GetById(id); var model = VideoModel.Create(video); model.AnnouncementApplicationId = announcementApplicationId; return View("Preview", model); }
public ActionResult Edit(string query, int announcementApplicationId) { var model = new SearchModel(); model.Query = query; if (string.IsNullOrEmpty(query) ) { var chalkableConnector = new ChalkableConnector(OauthClient); var anap = chalkableConnector.GetAnnouncementApplicationById(announcementApplicationId); var ann = chalkableConnector.GetAnnouncemnetById(anap.data.announcementid); query = [email protected]; } var connector = new YoutubeConnector(); var videos = connector.Search(query); model.Videos = videos.Select(VideoModel.Create); model.AnnouncementApplicationId = announcementApplicationId; return View("Edit", model); }