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

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

                return(dao.DeletarBD(_id));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #3
0
        public Dictionary <Int64, Historia> ListarHistorias()
        {
            try
            {
                Dictionary <Int64, Historia> mapaHistorias = new Dictionary <Int64, Historia>();
                HistoriaDAO dao = new HistoriaDAO();

                foreach (Historia o in dao.ListarTodos())
                {
                    mapaHistorias.Add(o.id, o);
                }

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