Example #1
0
        //Excluir
        public void Excluir(int id)
        {
            if (id < 1)
            {
                throw new Exception("Selecione um tema antes de excluí-lo.");
            }
            TemaDal obj = new TemaDal();

            obj.Excluir(id);
        }
Example #2
0
        //Incluir
        public void Incluir(Tema tema)
        {
            //O nome do usuario é obrigatório
            //trim retira espaços a esquerda e a direita
            if (tema.TemaFesta.Trim().Length == 0)
            {
                throw new Exception("A descrição do tema é obrigatório");
            }
            if (tema.CorToalhaMesa.Trim().Length == 0)
            {
                throw new Exception("A cor da toalha de mesa é obrigatório");
            }

            //Se tudo está Ok, chama a rotina de inserção.
            TemaDal obj = new TemaDal();

            obj.Incluir(tema);
        }
Example #3
0
        //Lista os Temas
        public DataTable Listagem()
        {
            TemaDal obj = new TemaDal();

            return(obj.Listagem());
        }
Example #4
0
        //Alterar
        public void Alterar(Tema tema)
        {
            TemaDal obj = new TemaDal();

            obj.Alterar(tema);
        }
Example #5
0
 //Esse é o construtor da classe UsusarioBll
 public TemaBll()
 {
     objDAL = new TemaDal();
 }