예제 #1
0
        public Boolean InserirBD(Favorito _objeto)
        {
            try
            {
                FavoritoDAO dao = new FavoritoDAO();

                return(dao.InserirBD(_objeto));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #2
0
        public Boolean RemoverBD(int _id)
        {
            try
            {
                FavoritoDAO dao = new FavoritoDAO();

                return(dao.DeletarBD(_id));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #3
0
        public Dictionary <Int64, Favorito> ListarFavoritosDeUsuario(Usuario u)
        {
            try
            {
                Dictionary <Int64, Favorito> mapaFavoritos = new Dictionary <Int64, Favorito>();
                FavoritoDAO dao = new FavoritoDAO();

                foreach (Favorito o in dao.BuscarFavoritosPorUsuario(u.Id))
                {
                    mapaFavoritos.Add(o.Usuario.Id, o);
                }

                return(mapaFavoritos);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }