示例#1
0
 public bool Excluir(int id)
 {
     try
     {
         diretoria_TA = new diretoriasTableAdapter();
         return(diretoria_TA.Excluir(id) > 0);
     }
     catch (SqlException exception)
     {
         throw exception;
     }
 }
示例#2
0
        public DataTable Listar()
        {
            try
            {
                diretoria_TA = new diretoriasTableAdapter();

                return(diretoria_TA.GetData());
            }
            catch (SqlException exception)
            {
                throw exception;
            }
        }
示例#3
0
        public bool Salvar(Diretoria diretoria, bool salvar)
        {
            try
            {
                diretoria_TA = new diretoriasTableAdapter();

                if (salvar)
                {
                    return(diretoria_TA.Salvar(diretoria.nome, diretoria.responsavel, diretoria.telefone1, diretoria.telefone2, diretoria.telefone3, diretoria.email) > 0);
                }
                return(diretoria_TA.Atualizar(diretoria.nome, diretoria.responsavel, diretoria.telefone1, diretoria.telefone2, diretoria.telefone3, diretoria.email, diretoria.codigo) > 0);
            }
            catch (SqlException exception)
            {
                throw exception;
            }
        }