This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - Acesso a Dados - Somente a conexão | |
2 - Domínio - Somente classes POCO | |
3 - Repositório: Projetos de acesso a dados | |
3.1 - Repositório.Comum: 1 interface genérica de repositório | |
3.2 - Repositório.Comum.Dapper: Classe abstrata semi-implementada para o Dapper | |
3.3 - Projeto.Repositório: Implementa todas classes de repositório com só o que falta, ou faz override. | |
4 - (por último) Google Drive: Integrar utilização de GoogleDrive, conforme as necessidades do sistema. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Interface | |
public interface IContextTransactionScope | |
{ | |
void ExecuteInTransactionScope(Action action); | |
TResult ExecuteInTransactionScope<TResult>(Func<TResult> predicate); | |
DbContext GetContext(); | |
} | |
-- Implementação em Entity | |
public class ContextTransactionScope : IContextTransactionScope |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'public ' || | |
case when data_type like '%CHAR%' then ' string' | |
when data_type like '%NUMBER%' then ' decimal' | |
when data_type like '%DATE%' then ' DateTime' | |
end | |
|| | |
case when data_type like '%NUMBER%' AND NULLABLE = 'Y' then '?' | |
when data_type like '%DATE%' AND NULLABLE = 'Y' then '?' | |
end | |
|| ' _'|| lower(COLUMN_NAME) ||';' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Object in Oracle. Prefer this one for queries. | |
-- don't use Records, records are PL/SQL types and cannot be used in SQL queries | |
create or replace type OBJETO_OSSPP is object( | |
PORT_ID NUMBER(5), | |
OPP_DESCRIPTION VARCHAR2(50), | |
OPP_STATUS CHAR(1), | |
OPP_REGDATE DATE, | |
OPP_REGUSER VARCHAR2(20) | |
);/ | |
create or replace type TABLE_OBJETO_OSSPP as table of OBJETO_OSSPP; / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.currency').keypress(function(event) { | |
var $this = $(this); | |
if ((event.which != 46 || $this.val().indexOf('.') != -1) && | |
((event.which < 48 || event.which > 57) && | |
(event.which != 0 && event.which != 8))) { | |
event.preventDefault(); | |
} | |
var text = $(this).val(); | |
if ((event.which == 46) && (text.indexOf('.') == -1)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*Necessário instalar o Node e Git | |
################################################################ | |
Angular CLI | |
Ferramenta para se criar e fazer build de projetos com apenas um comando. Também sobe um servidor de desenvolvimento e cria arquivos. | |
################################################################ | |
Ambiente de Trabalho | |
Instale o Node.js em https://nodejs.org | |
Instale o Angular CLI com o comando: | |
$ npm i -g @angular/cli |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Criando um novo projeto | |
Execute o comando: | |
$ ng new nome-projeto | |
Opções que podem ser adicionadas ao comando de criação do projeto: | |
--prefix (-p): Permite indicar um prefixo; | |
--routing: Gera um arquivo para o gerenciamento de rotas; | |
--style: Permite indicar o tipo de estilização (CSS, Sass, Less, etc); | |
--inline-style (-s): Indica se queremos CSS dentro do próprio arquivo JS; | |
--inline-template (-t): Indica se queremos HTML dentro do próprio arquivo JS. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Servidor de Desenvolvimento | |
Execute o comando: | |
$ ng serve [nome do projeto - opcional] | |
Acesse pelo navegador o endereço http://localhost:4200 | |
Opções que podem ser adicionadas ao comando de inicialização do servidor | |
--open (-o): Abre o navegador assim que o servidor iniciar; | |
--port: Permite iniciar o servidor em outra porta ao invés da padrão 4200; | |
--host: Permite iniciar o servidor em outro host; | |
--progress: Mostra o progresso do processo de construção da aplicação. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comandos para gerar arquivos | |
############################################################# | |
Inicie o comando com: | |
$ ng g | |
Onde: | |
“ng” chama o Angular CLI; | |
“g” ou “generate” é o comando para gerar algo. | |
Em seguida adicione o que deseja criar e o nome que você quer dar ao elemento a ser criado. | |
### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Análise da Qualidade do Código | |
Execute o comando: | |
$ ng lint | |
Testes Unitários | |
Execute o comando: | |
$ ng test | |
Testes End to End | |
Execute o comando: |