Skip to content

Instantly share code, notes, and snippets.

View facilita-tecnologia's full-sized avatar

Facilita Tecnologia facilita-tecnologia

View GitHub Profile
@facilita-tecnologia
facilita-tecnologia / NFCe.cs
Created November 21, 2018 12:17
Metodos de configurações
public void Inicializar_Tipo_Certificado(int Valor)
{
ComboboxItem a1 = new ComboboxItem();
a1.Text = "1 - Certificado A1";
a1.Valor_inteiro = 0;
ComboboxItem a1_arquivo = new ComboboxItem();
a1_arquivo.Text = "2 - Certificado A1 em Arquivo";
a1_arquivo.Valor_inteiro = 1;
@facilita-tecnologia
facilita-tecnologia / Masracas.cs
Created October 24, 2018 12:21
Mascaras para Textbox Valor monetario Jocinardo
// Com esse método o R$ fica fixo e a vírgula se move de acordo com as casas decimais
//
//Crie um textbox com o name txt_valor e adicione os eventos KeyPress, KeyUp, Leave e //uma string valor
string valor;
private void txt_valor_KeyPress(object sender, KeyPressEventArgs e)
{
if (!Char.IsDigit(e.KeyChar) && e.KeyChar != Convert.ToChar(Keys.Back))
{
if (e.KeyChar == ',')
@facilita-tecnologia
facilita-tecnologia / Android.java
Created September 16, 2018 00:53
Abrir Menu Android
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
byte[] cc = new byte[]{0x1B,0x21,0x00}; // 0- normal size text
byte[] bb = new byte[]{0x1B,0x21,0x08}; // 1- only bold text
byte[] bb2 = new byte[]{0x1B,0x21,0x20}; // 2- bold with medium text
byte[] bb3 = new byte[]{0x1B,0x21,0x10}; // 3- bold with large text
outputStream.write(cc);
outputStream.write("Your String");
var arquivoXml = Funcoes.BuscarArquivoXml();
if (!string.IsNullOrWhiteSpace(arquivoXml))
{
_nfe = new NFe.Classes.NFe().CarregarDeArquivoXml(arquivoXml);
// Informações
_Fornecedor.NOME = _nfe.infNFe.emit.xNome;
_Fornecedor.FANTASIA = _nfe.infNFe.emit.xFant;
_Fornecedor.CPF_CNPJ = _nfe.infNFe.emit.CNPJ;
@facilita-tecnologia
facilita-tecnologia / PhonecallReceiver.java
Created April 20, 2018 21:55 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@facilita-tecnologia
facilita-tecnologia / gist:085de437c0bad3b1ad184f09848f63b6
Created February 14, 2018 03:22
Resolver problema de 404 laravel 5.4 e php 7.1
2
down vote
I resolved by doing the following: Check if there is a module called rewrite.load in your apache at:
$ cd /etc/apache2/mods-enabled/
If it does not exist execute the following excerpt:
$sudo a2enmod rewrite
Otherwise, change the Apache configuration file to consolidate use of the "friendly URL".
private void PreencherICMS(ICMSBasico ICMS, ItemNFeEntrada Prod)
{
/* Simples Nacional */
if (ICMS.GetType() == typeof(ICMSSN101))
{
Prod.CSTICMS = ((int)(ICMS as ICMSSN101).CSOSN).ToString();
Prod.ORIG = ((int)(ICMS as ICMSSN101).orig).ToString();
}
if (ICMS.GetType() == typeof(ICMSSN102))
// ICMS
// Verificações p/ Simples Nacional
if (_NF_Entrada.CRT == "1")
{
var CSOSN_101 = item.imposto.ICMS.TipoICMS as ICMSSN101;
var CSOSN_102 = item.imposto.ICMS.TipoICMS as ICMSSN102;
@facilita-tecnologia
facilita-tecnologia / Helper.cs
Created November 24, 2017 19:45
Conversor de Enum
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace SGI
{
public static class Helper