コード例 #1
0
        public string Excluir(TRegistro_SpedContabil val)
        {
            System.Collections.Hashtable hs = new System.Collections.Hashtable(2);
            hs.Add("@P_CD_EMPRESA", val.Cd_empresa);
            hs.Add("@P_ID_SPED", val.Id_sped);

            return(this.executarProc("EXCLUI_CTB_SPEDCONTABIL", hs));
        }
コード例 #2
0
        public TList_SpedContabil Select(Utils.TpBusca[] vBusca, Int32 vTop, string vNM_Campo)
        {
            TList_SpedContabil lista = new TList_SpedContabil();

            System.Data.SqlClient.SqlDataReader reader = null;
            bool podeFecharBco = false;

            if (Banco_Dados == null)
            {
                podeFecharBco = this.CriarBanco_Dados(false);
            }

            try
            {
                reader = this.ExecutarBusca(this.SqlCodeBusca(vBusca, Convert.ToInt16(vTop), vNM_Campo));
                while (reader.Read())
                {
                    TRegistro_SpedContabil reg = new TRegistro_SpedContabil();

                    if (!reader.IsDBNull(reader.GetOrdinal("cd_empresa")))
                    {
                        reg.Cd_empresa = reader.GetString(reader.GetOrdinal("cd_empresa"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("nm_empresa")))
                    {
                        reg.Nm_empresa = reader.GetString(reader.GetOrdinal("nm_empresa"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("id_sped")))
                    {
                        reg.Id_sped = reader.GetDecimal(reader.GetOrdinal("id_sped"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("nr_sped")))
                    {
                        reg.Nr_sped = reader.GetDecimal(reader.GetOrdinal("nr_sped"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("dt_ini")))
                    {
                        reg.Dt_ini = reader.GetDateTime(reader.GetOrdinal("dt_ini"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("dt_fin")))
                    {
                        reg.Dt_fin = reader.GetDateTime(reader.GetOrdinal("dt_fin"));
                    }
                    lista.Add(reg);
                }
            }
            finally
            {
                reader.Close();
                reader.Dispose();
                if (podeFecharBco)
                {
                    this.deletarBanco_Dados();
                }
            }
            return(lista);
        }
コード例 #3
0
        public string Gravar(TRegistro_SpedContabil val)
        {
            System.Collections.Hashtable hs = new System.Collections.Hashtable(5);
            hs.Add("@P_CD_EMPRESA", val.Cd_empresa);
            hs.Add("@P_ID_SPED", val.Id_sped);
            hs.Add("@P_NR_SPED", val.Nr_sped);
            hs.Add("@P_DT_INI", val.Dt_ini);
            hs.Add("@P_DT_FIN", val.Dt_fin);

            return(this.executarProc("IA_CTB_SPEDCONTABIL", hs));
        }