public object FormularioCompleto() { Episodio = new EpisodioModel(); Console.Clear(); Console.WriteLine("Informe o Nome"); Episodio.Nome = Console.ReadLine(); return(Episodio); }
public object FormularioSimples() { Episodio = new EpisodioModel(); Console.Clear(); Console.WriteLine("Informe o Nome atual do Episodio"); Episodio.Nome = Console.ReadLine(); return(Episodio); }
public object Buscar(object item, object pai) { var temporada = (TemporadaModel)pai; var episodio = (EpisodioModel)item; EpisodioModel busca = temporada.Episodios .Where(x => x.Nome.Equals(episodio.Nome)) .SingleOrDefault(); return(busca); }
private void MontaListEpisodios(string serie) { List <string> nome = serie.Split(' ').ToList(); nome.RemoveAll(x => x.Length < 3); foreach (FileInfo arquivo in videos) { if (NomeBate(arquivo.Name, nome)) { // Split on one or more non-digit characters. string value = ""; //99X99 if (Regex.Match(arquivo.Name, @"[^0-9][0-9][0-9][^0-9][0-9][0-9][^0-9]").Success) { value = Regex.Match(arquivo.Name, @"[^0-9][0-9][0-9][^0-9][0-9][0-9][^0-9]").Value.ToString(); value = value.Remove(0, 1); value = value.Remove(value.Length - 1, 1); EpisodioModel em = new EpisodioModel(serie, Int32.Parse(value.Substring(0, 2)), Int32.Parse(value.Substring(3, 2))); em.CaminhoVideo = arquivo.FullName; episodios.Add(em); } //9X99 else if (Regex.Match(arquivo.Name, @"[^0-9][0-9][^0-9][0-9][0-9][^0-9]").Success) { value = Regex.Match(arquivo.Name, @"[^0-9][0-9][^0-9][0-9][0-9][^0-9]").Value.ToString(); value = value.Remove(0, 1); value = value.Remove(value.Length - 1, 1); EpisodioModel em = new EpisodioModel(serie, Int32.Parse(value.Substring(0, 1)), Int32.Parse(value.Substring(2, 2))); em.CaminhoVideo = arquivo.FullName; episodios.Add(em); } //99X9 else if (Regex.Match(arquivo.Name, @"[^0-9][0-9][0-9][^0-9][0-9][^0-9]").Success) { value = Regex.Match(arquivo.Name, @"[^0-9][0-9][0-9][^0-9][0-9][^0-9]").Value.ToString(); value = value.Remove(0, 1); value = value.Remove(value.Length - 1, 1); EpisodioModel em = new EpisodioModel(serie, Int32.Parse(value.Substring(0, 2)), Int32.Parse(value.Substring(3, 1))); em.CaminhoVideo = arquivo.FullName; episodios.Add(em); } //9X9 else if (Regex.Match(arquivo.Name, @"[^0-9][0-9][0-9][^0-9][0-9][0-9][^0-9]").Success) { value = Regex.Match(arquivo.Name, @"[^0-9][0-9][0-9][^0-9][0-9][0-9][^0-9]").Value.ToString(); EpisodioModel em = new EpisodioModel(serie, Int32.Parse(value.Substring(0, 1)), Int32.Parse(value.Substring(1, 1))); em.CaminhoVideo = arquivo.FullName; episodios.Add(em); } else { string[] numbers = Regex.Split(arquivo.Name, @"\D+"); numbers = numbers.Where(x => x.Length < 3 && !x.Equals("")).ToArray(); if (numbers.Length > 1) { try { EpisodioModel em = new EpisodioModel(serie, Int32.Parse(numbers[0]), Int32.Parse(numbers[1])); em.CaminhoVideo = arquivo.FullName; episodios.Add(em); } catch { } } } } } }