Esempio n. 1
0
        public DataTable ListarPorNome()
        {
            try
            {
                Agendadao agendadao = new Agendadao();
                DataTable dt        = new DataTable();

                dt = agendadao.ListarItemPorNome();

                return(dt);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        public void ExcluirAgenda(String Id_Excluir)
        {
            this.mensagem = "";
            validarAgenda validarAgenda = new validarAgenda();

            Agenda agenda = new Agenda();

            agenda.Id = Convert.ToInt32(Id_Excluir);
            Agendadao agendadao = new Agendadao();

            if (agendadao.ListarItemPorNome() != null)
            {
                agendadao.ExcluirAgenda(agenda);
                this.mensagem = agendadao.mensagem;
            }
            else
            {
                this.mensagem = "Não existe este ID";
            }
        }