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
public static class ObjectExtensions | |
{ | |
public static bool HasValueProperty(this object obj, string propertyName) | |
{ | |
if (!obj.ExistsProperty(propertyName)) | |
return false; | |
var type = obj.GetType(); | |
var properties = type.GetProperties(); | |
var allProperties = AllProperties(properties); |
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
function isValidCPF(number) { | |
var sum; | |
var rest; | |
sum = 0; | |
if (number == "00000000000") return false; | |
for (i=1; i<=9; i++) sum = sum + parseInt(number.substring(i-1, i)) * (11 - i); | |
rest = (sum * 10) % 11; | |
if ((rest == 10) || (rest == 11)) rest = 0; |
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
public bool IsValidCPF(string value) | |
{ | |
if (value == null) | |
return false; | |
value = value.NormalizeString(); | |
if (value.Length != 11) | |
return false; | |
var cpf = value.Select(c => c.ToInt()).ToList(); |
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
public class AuthenticationManagerCustom implements AuthenticationManager{ | |
@Autowired | |
private UserService userService; | |
@Override | |
public Authentication authenticate(Authentication auth) throws AuthenticationException { | |
String username = auth.getName(); | |
String password = auth.getCredentials().toString(); | |
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
NFSeProxy.ComponenteNFSe.ImpressaoModo = ModoImpressao.printNFSe; | |
NFSeProxy.ComponenteNFSe.Impressao_CriarDatasets(xml); | |
NFSeProxy.ComponenteNFSe.Impressao_Editar(); | |
NFSeProxy.ComponenteNFSe.Impressao_SetCampo("OutrasInformacoes", @"*** DOCUMENTO EMITIDO POR ME OU EPP OPTANTE PELO SIMPLES NACIONAL *** | |
O prestador do (s)serviço(s) possui regime especial de tributação: Microempresário e Empresa de Pequeno Porte(ME -EPP) | |
Valor aproximado dos tributos com base na Lei 12.741 / 2012 - R$ 368,26 - (18, 45 %) - Fonte: IBPT"); | |
NFSeProxy.ComponenteNFSe.Impressao_Salvar(); |
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
@Entity | |
@Table(name="roles") | |
public class Role{ | |
//Contructor | |
public Role(...){}; | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) |
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
var xml = spdNFSeConverterX.ConverterEnvioNFSe(tx2); | |
var xmlAssinado = spdProxyNFSeX.Assinar(xml); | |
spdProxyNFSeX.Enviar(xmlAssinado, ""); | |
var xmlResposta = File.ReadAllText(NFSeProxy.ComponenteNFSe.UltimoLogRecibo); | |
var retorno = IspdNFSeConverterX.ConverterRetEnvioNFSeTipo(xmlResposta); | |
var protocoloConsulta = retorno?.NumeroProtocolo; |
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
package com.zieg.ApplicationManager; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | |
@EnableJpaAuditing | |
@SpringBootApplication | |
public class ApplicationManager { |
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
function divisao(dividendo, divisor){ | |
var quociente = 0; | |
var resto = 0; | |
while(dividendo > 0 && dividendo >= divisor){ | |
quociente = soma(quociente, 1); | |
dividendo = subtrair(dividendo, divisor); | |
} | |
resto = dividendo; | |
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
function requestCliente(dados, url) { | |
return $.ajax({ | |
url: url, | |
contentType: "application/json; charset=utf-8", | |
responseType: "json", | |
dataType: "json", | |
data: dados, | |
cache: false |
NewerOlder