Exemple #1
0
        private List <SqlParametros> PreencheCondicoes(TabelaIBPT tabelaIBPT)
        {
            List <SqlParametros> lstParametrosCondicionais = new List <SqlParametros>();

            lstParametrosCondicionais.Add(new SqlParametros("NCM", tabelaIBPT.NCM));

            return(lstParametrosCondicionais);
        }
Exemple #2
0
        private List <SqlParametros> PreencheParametros(TabelaIBPT tabelaIBPT)
        {
            List <SqlParametros> lstParametros = new List <SqlParametros>();

            lstParametros.Add(new SqlParametros("NCM", tabelaIBPT.NCM));
            lstParametros.Add(new SqlParametros("Ex", tabelaIBPT.Ex));
            lstParametros.Add(new SqlParametros("Tipo", tabelaIBPT.Tipo));
            lstParametros.Add(new SqlParametros("Descricao", tabelaIBPT.Descricao));
            lstParametros.Add(new SqlParametros("Aliq_Federal_Nacional", tabelaIBPT.Aliq_Federal_Nacional.ToString().Replace(".", "").Replace(",", ".")));
            lstParametros.Add(new SqlParametros("Aliq_Federal_Importado", tabelaIBPT.Aliq_Federal_Importado.ToString().Replace(".", "").Replace(",", ".")));
            lstParametros.Add(new SqlParametros("Aliq_Estadual", tabelaIBPT.Aliq_Estadual.ToString().Replace(".", "").Replace(",", ".")));
            lstParametros.Add(new SqlParametros("Aliq_Municipal", tabelaIBPT.Aliq_Municipal.ToString().Replace(".", "").Replace(",", ".")));

            return(lstParametros);
        }
Exemple #3
0
        public TabelaIBPT PesquisarAliquotasFederalEstadualMunicipal(string ncm)
        {
            DataTable dt = new DataTable();

            dt = conexao.Pesquisar(string.Format("{0} WHERE NCM = '{1}'", sqlDefault, ncm));

            TabelaIBPT ibpt = new TabelaIBPT();

            if (dt.Rows.Count > 0 && dt != null)
            {
                ibpt.Aliq_Federal_Nacional  = Convert.ToDecimal(dt.Rows[0]["Aliq_Federal_Nacional"]);
                ibpt.Aliq_Federal_Importado = Convert.ToDecimal(dt.Rows[0]["Aliq_Federal_Importado"]);
                ibpt.Aliq_Estadual          = Convert.ToDecimal(dt.Rows[0]["Aliq_Estadual"]);
                ibpt.Aliq_Municipal         = Convert.ToDecimal(dt.Rows[0]["Aliq_Municipal"]);
            }

            return(ibpt);
        }
Exemple #4
0
        public TabelaIBPT PesquisarValoresIBPT(string ncm)
        {
            TabelaIBPT ibpt = new TabelaIBPT();

            if (ncm.Length.Equals(8))
            {
                DataTable dtResult = new DataTable();
                for (int i = 8; i > 0; i--)
                {
                    dtResult = conexao.Pesquisar("SELECT ISNULL(Aliq_Federal_Nacional, 0) AS Aliq_Federal_Nacional, ISNULL(Aliq_Federal_Importado, 0) AS Aliq_Federal_Importado, ISNULL(Aliq_Estadual, 0) AS Aliq_Estadual, ISNULL(Aliq_Municipal, 0) AS Aliq_Municipal FROM TabelaIBPT WHERE NCM = " + ncm.Substring(0, i));
                    if (dtResult.Rows.Count > 0)
                    {
                        ibpt.Aliq_Federal_Nacional  = Convert.ToDecimal(dtResult.Rows[0]["Aliq_Federal_Nacional"]);
                        ibpt.Aliq_Federal_Importado = Convert.ToDecimal(dtResult.Rows[0]["Aliq_Federal_Importado"]);
                        ibpt.Aliq_Estadual          = Convert.ToDecimal(dtResult.Rows[0]["Aliq_Estadual"]);
                        ibpt.Aliq_Municipal         = Convert.ToDecimal(dtResult.Rows[0]["Aliq_Municipal"]);

                        break;
                    }
                }
            }

            return(ibpt);
        }
Exemple #5
0
 public Boolean Excluir(TabelaIBPT tabelaIBPT)
 {
     return(conexao.Excluir(nomeTabela, PreencheCondicoes(tabelaIBPT)));
 }
Exemple #6
0
 public Boolean Alterar(TabelaIBPT tabelaIBPT)
 {
     return(conexao.Atualizar(nomeTabela, PreencheParametros(tabelaIBPT), PreencheCondicoes(tabelaIBPT)));
 }
Exemple #7
0
 public Boolean Inserir(TabelaIBPT tabelaIBPT)
 {
     return(conexao.Inserir(nomeTabela, PreencheParametros(tabelaIBPT)));
 }