public TRegistro_EventoCTe() { this.Cd_empresa = string.Empty; this.nr_lanctoctr = null; this.nr_lanctoctrstr = string.Empty; this.nr_ctrc = null; this.nr_ctrcstr = string.Empty; this.Chaveacesso = string.Empty; this.id_evento = null; this.id_eventostr = string.Empty; this.cd_evento = null; this.cd_eventostr = string.Empty; this.dt_evento = null; this.dt_eventostr = string.Empty; this.Justificativa = string.Empty; this.nr_protocolo = null; this.nr_protocolostr = string.Empty; this.Tp_evento = string.Empty; this.Ds_evento = string.Empty; this.Xml_evento = string.Empty; this.Xml_retevent = string.Empty; this.st_registro = "A"; this.status = "ABERTO"; this.lCamposCC = new TList_CamposCC(); }
public TList_CamposCC Select(Utils.TpBusca[] vBusca, Int32 vTop, string vNM_Campo) { TList_CamposCC lista = new TList_CamposCC(); 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_CamposCC reg = new TRegistro_CamposCC(); if (!reader.IsDBNull(reader.GetOrdinal("id_evento"))) { reg.Id_evento = reader.GetDecimal(reader.GetOrdinal("id_evento")); } if (!reader.IsDBNull(reader.GetOrdinal("cd_empresa"))) { reg.Cd_empresa = reader.GetString(reader.GetOrdinal("cd_empresa")); } if (!reader.IsDBNull(reader.GetOrdinal("NR_LanctoCTR"))) { reg.Nr_lanctoCTR = reader.GetDecimal(reader.GetOrdinal("NR_LanctoCTR")); } if (!reader.IsDBNull(reader.GetOrdinal("ID_Campo"))) { reg.Id_campo = reader.GetDecimal(reader.GetOrdinal("ID_Campo")); } if (!reader.IsDBNull(reader.GetOrdinal("DS_Grupo"))) { reg.Ds_grupo = reader.GetString(reader.GetOrdinal("DS_Grupo")); } if (!reader.IsDBNull(reader.GetOrdinal("DS_Campo"))) { reg.Ds_campo = reader.GetString(reader.GetOrdinal("DS_Campo")); } if (!reader.IsDBNull(reader.GetOrdinal("ValorAlterado"))) { reg.ValorAlterado = reader.GetString(reader.GetOrdinal("ValorAlterado")); } lista.Add(reg); } } finally { reader.Close(); reader.Dispose(); if (podeFecharBco) { this.deletarBanco_Dados(); } } return(lista); }