public override string Processar(EntidadeDominio entidade) { try { Livro liv = (Livro)entidade; AutorDAO forn = new AutorDAO(); for (int i = 0; i < liv.Autores.Count; i++) { Autor endereco = liv.Autores[i]; List <EntidadeDominio> ende = forn.Consultar(endereco); if (ende.Count > 0) { liv.Autores[i] = (Autor)ende.ElementAt(0); } else { forn.Salvar(liv.Autores[i]); ende = forn.Consultar(liv.Autores[i]); liv.Autores[i] = (Autor)ende.ElementAt(0); } } return(null); } catch (Exception e) { return(e.Message); } }
public override string Processar(EntidadeDominio entidade) { AutorDAO Adao = new AutorDAO(); LivroDAO lDAO = new LivroDAO(); throw new NotImplementedException(); }
public void UpdateAutor(Autor autor) { AutorDAO autorDAO = new AutorDAO(); if (autor.Nome != "") { autorDAO.Update(autor); } }
public void DeletarAutor(Autor autor) { AutorDAO autorDAO = new AutorDAO(); if (autor.AutorId != 0) { autorDAO.delete(autor); } }
public void InserirAutor(Autor autor) { AutorDAO autorDAO = new AutorDAO(); if (autor.Nome != "") { autorDAO.Insert(autor); } }
public void AutorDAO_EsClaveRepetida_Clave1_EsTrue() { //Inicializar datos AutorDAO autorDAO = new AutorDAO(contexto); //Ejecutar método var esRepetido = autorDAO.EsClaveRepetida(2, 1); //Comprobar resultado Assert.True(esRepetido); }
public void BuscarAutorID(Autor autor) { AutorDAO autorDAO = new AutorDAO(); if (autor.AutorId > 0) { var autorTemp = autorDAO.BuscarId(autor.AutorId); autor.Nome = autorTemp.Nome; autor.Nacionalidade = autorTemp.Nacionalidade; } }
public IList <Autor> BuscarPorNome(Autor autor) { AutorDAO autorDAO = new AutorDAO(); if (autor.Nome != "") { IList <Autor> autorTemp = autorDAO.BuscarPorAutor(autor.Nome); return(autorTemp); } else { return(null); } }
public bool Gravar(Autor obj) { if (obj.Nome != string.Empty) { int sucesso = new AutorDAO().Gravar(obj); if (sucesso != 0) { return(true); } else { return(false); } } else { return(false); } }
public AutorService() { oAutorDAO = new AutorDAO(); }
public AutoresController(CursosContext contexto) { autorDAO = new AutorDAO(contexto); }
public static List <Autor> ObtenerPorCoincidenciaNombre(string nombre) { return(AutorDAO.SelectByLikeNombre(nombre)); }