示例#1
0
        public TList_CadNCM Select(TpBusca[] vBusca, int vTop, string vNM_Campo)
        {
            bool         podeFecharBco = false;
            TList_CadNCM lista         = new TList_CadNCM();

            if (Banco_Dados == null)
            {
                podeFecharBco = CriarBanco_Dados(false);
            }
            SqlDataReader reader = ExecutarBusca(SqlCodeBusca(vBusca, vTop, vNM_Campo));

            try
            {
                while (reader.Read())
                {
                    TRegistro_CadNCM reg = new TRegistro_CadNCM();

                    if (!(reader.IsDBNull(reader.GetOrdinal("NCM"))))
                    {
                        reg.NCM = reader.GetString(reader.GetOrdinal("NCM"));
                    }
                    if (!(reader.IsDBNull(reader.GetOrdinal("CF"))))
                    {
                        reg.CF = reader.GetString(reader.GetOrdinal("CF"));
                    }
                    if (!(reader.IsDBNull(reader.GetOrdinal("DS_NCM"))))
                    {
                        reg.Ds_NCM = reader.GetString(reader.GetOrdinal("DS_NCM"));
                    }
                    if (!(reader.IsDBNull(reader.GetOrdinal("PC_ALIQUOTA"))))
                    {
                        reg.PC_Aliquota = reader.GetDecimal(reader.GetOrdinal("PC_ALIQUOTA"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("CEST")))
                    {
                        reg.CEST = reader.GetString(reader.GetOrdinal("CEST"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("DT_FinVigencia")))
                    {
                        reg.Dt_DT_FimVigencia = reader.GetDateTime(reader.GetOrdinal("DT_FinVigencia"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("DT_IniVigencia")))
                    {
                        reg.Dt_DT_IniVigencia = reader.GetDateTime(reader.GetOrdinal("DT_IniVigencia"));
                    }

                    lista.Add(reg);
                }
            }
            finally
            {
                reader.Close();
                reader.Dispose();
                if (podeFecharBco)
                {
                    deletarBanco_Dados();
                }
            }
            return(lista);
        }
示例#2
0
        public string DeletarNCM(TRegistro_CadNCM val)
        {
            Hashtable hs = new Hashtable(1);

            hs.Add("@P_NCM", val.NCM);

            return(executarProc("EXCLUI_FIS_NCM", hs));
        }
示例#3
0
        public string GravarNCM(TRegistro_CadNCM val)
        {
            Hashtable hs = new Hashtable(8);

            hs.Add("@P_NCM", val.NCM.Trim());
            hs.Add("@P_CF", val.CF);
            hs.Add("@P_DS_NCM", val.Ds_NCM);
            hs.Add("@P_PC_ALIQUOTA", val.PC_Aliquota);
            hs.Add("@P_CEST", val.CEST);
            hs.Add("@P_DT_INIVIGENCIA", val.Dt_DT_IniVigenciastr);
            hs.Add("@P_DT_FINVIGENCIA", val.Dt_DT_FimVigenciastr);

            return(executarProc("IA_FIS_NCM", hs));
        }