Beispiel #1
0
        public AutorWS GetAutorById(int codAutor)
        {
            AutorWS autor = null;

            gestionbibliotecaMVC.BBLL.interfaces.AutorService aS = new AutorServiceImp();
            gestionbibliotecaMVC.Models.Autor aux = aS.getById(codAutor);
            autor = new AutorWS();

            if (aS == null)
            {
                autor.ErrorMessage = "Autor no encontrado.";
            }
            else
            {
                autor.Nombre = aux.Nombre + " " + aux.Apellidos;
            }

            return(autor);
        }
Beispiel #2
0
        public Autor getAutorById(int codAutor)
        {
            Autor autor = null;

            gestionbibliotecaMVC.BBLL.interfaces.AutorService aS = new AutorServiceImp();
            gestionbibliotecaMVC.Models.Autor aux = aS.getById(codAutor);

            if (aux == null)
            {
                autor.ErrorMessage = "El autor no se ha encontrado";
                throw new Exception();
            }
            else
            {
                autor.Nombre    = aux.Nombre;
                autor.Apellidos = aux.Apellidos;
            }

            return(autor);
        }