public ActionResult Edit(TvSerie tvSerie) { if (ModelState.IsValid) { var entity = Mapper.Map <TvSerie>(tvSerie); tvSerieService.Update(entity); return(RedirectToAction("Index")); } return(View(tvSerie)); }
public override void retrieveTvStreamLinks(TvSerie serie) { try { var target = serie.getSeriePageLink(); var handler = new ClearanceHandler("http://*****:*****@id=\"sequex-main-inner\"]/div[1]/article/div[1]/table[1]/tbody/tr/td/div/div[2]"); if (node == null) { return; } foreach (var parent in node) { foreach (var toAnalyze in parent.ChildNodes) { if (toAnalyze.InnerHtml.ToLower().Contains("stayonline")) { string episode = WebUtility.HtmlDecode(toAnalyze.ChildNodes.FirstOrDefault().InnerText).Replace(" -", ""); Dictionary <string, string> links = new Dictionary <string, string>(); for (int i = 1; i < toAnalyze.ChildNodes.Count; i++) { if (!toAnalyze.ChildNodes[i].Name.ToLower().Contains("text")) { //It need to be redone try { string provider = toAnalyze.ChildNodes[i].InnerText; string link = toAnalyze.ChildNodes[i].Attributes[0].Value; links.Add(provider, link); } catch { } } } serie.addLink(episode, links); } } } } catch (Exception ex) { Console.WriteLine(ex.InnerException.Message); } }
public void CreateTvSerieReview(string thoughts, int score, int tvSerieId, int userId) { TvSerieReview tsr = new TvSerieReview { Thoughts = thoughts, Score = score }; TvSerie t = new TvSerie { ItemID = tvSerieId }; tsr.TvSerie = t; rda.CreateTvSerieReview(tsr, userId); }
public override void retrieveTvStreamLinks(TvSerie serie) { var handler = new ClearanceHandler("http://*****:*****@id=\"infoSerie\"]/div/div/div[2]/div/div[2]/p[2]"); serie.SerieDescription = WebUtility.HtmlDecode(nodeDescription.InnerText); var nodeSelected = htmlDoc.DocumentNode.SelectSingleNode("//*[@id=\"iframeVid\"]"); Dictionary <string, string> tmp = new Dictionary <string, string>(); tmp.Add("MainPanel", nodeSelected.Attributes[3].Value); serie.addLink("All Episodes", tmp); return; } catch { } }
public void Update(TvSerie tvSerie) { tvSerieRepository.Update(tvSerie); unitOfWork.SaveChanges(); }
public void Insert(TvSerie tvSerie) { tvSerieRepository.Insert(tvSerie); unitOfWork.SaveChanges(); }
public override void retrieveTvStreamLinks(TvSerie serie) { //TODO }
public ActionResult SaveOrUpdate(TvSerie tvSerie) { using (var uow = new UnitOfWork(true)) { if (tvSerie.Id != 0) { var oldSerie = uow.TvSeries.Find(tvSerie.Id); oldSerie.Title = tvSerie.Title; oldSerie.Genre = tvSerie.Genre; oldSerie.Creator = tvSerie.Creator; oldSerie.ReleaseDate = tvSerie.ReleaseDate; oldSerie.Summary = tvSerie.Summary; oldSerie.WikipediaLink = tvSerie.WikipediaLink; oldSerie.IsDone = tvSerie.IsDone; uow.TvSeries.SaveOrUpdate(oldSerie); } else { uow.TvSeries.SaveOrUpdate(tvSerie); } uow.Commit(); } return RedirectToAction("View", new { id = tvSerie.Id }); }
/// <summary> /// Saves or updates a series /// </summary> /// <param name="tvSerie">A series</param> public void SaveOrUpdate(TvSerie tvSerie) { if (tvSerie == null) { throw new ArgumentNullException("tvSerie"); } this.Session.SaveOrUpdate(tvSerie); }
public abstract void retrieveTvStreamLinks(TvSerie serie);