List <GlobaisEmpresaTaxasNotasBE> CarregaDados(GlobaisEmpresaTaxasNotasBE obj) { List <GlobaisEmpresaTaxasNotasBE> result = new List <GlobaisEmpresaTaxasNotasBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader(this.procedure, Globais.Helper.TipoSql.Select.ToString(), obj); if (dr.HasRows) { while (dr.Read()) { GlobaisEmpresaTaxasNotasBE item = new GlobaisEmpresaTaxasNotasBE(); item.confCom_id = DBNull.Value.Equals(dr["confCom_id "]) ? 0 : Convert.ToInt32(dr["confCom_id "]); item.conf_id = DBNull.Value.Equals(dr["conf_id "]) ? 0 : Convert.ToInt32(dr["conf_id "]); item.confCom_logo = dr["confCom_logo"].ToString(); item.confCom_calcularTributos = DBNull.Value.Equals(dr["confCom_calcularTributos"]) ? false : Convert.ToBoolean(dr["confCom_calcularTributos"]); item.confCom_valormaior = DBNull.Value.Equals(dr["confCom_valormaior"]) ? 0 : Convert.ToDecimal(dr["confCom_valormaior"]); item.confCom_pis = DBNull.Value.Equals(dr["confCom_pis"]) ? 0 : Convert.ToDecimal(dr["confCom_pis"]); item.confCom_confins = DBNull.Value.Equals(dr["confCom_confins"]) ? 0 : Convert.ToDecimal(dr["confCom_confins"]); item.confCom_cssl = DBNull.Value.Equals(dr["confCom_cssl"]) ? 0 : Convert.ToDecimal(dr["confCom_cssl"]); item.confCom_irrf = DBNull.Value.Equals(dr["confCom_irrf"]) ? 0 : Convert.ToDecimal(dr["confCom_irrf"]); item.confCom_boleto = DBNull.Value.Equals(dr["confCom_boleto"]) ? false : Convert.ToBoolean(dr["confCom_boleto"]); item.confCom_nota = DBNull.Value.Equals(dr["confCom_nota"]) ? false : Convert.ToBoolean(dr["confCom_nota"]); result.Add(item); } dr.Close(); } return(result); }
List <NTNotasItensBE> CarregaDados(NTNotasItensBE obj) { List <NTNotasItensBE> result = new List <NTNotasItensBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader(this.procedure, Globais.Helper.TipoSql.Select.ToString(), obj); if (dr.HasRows) { while (dr.Read()) { NTNotasItensBE item = new NTNotasItensBE(); item.notI_ind = DBNull.Value.Equals(dr["notI_ind "]) ? 0 : Convert.ToInt32(dr["notI_ind "]); item.not_id = DBNull.Value.Equals(dr["not_id "]) ? 0 : Convert.ToInt32(dr["not_id "]); item.not_numero = DBNull.Value.Equals(dr["not_numero "]) ? 0 : Convert.ToInt32(dr["not_numero "]); item.notI_qtde = DBNull.Value.Equals(dr["notI_qtde "]) ? 0 : Convert.ToInt32(dr["notI_qtde "]); item.notI_descricao = dr["notI_descricao"].ToString(); item.notI_precoUnitario = DBNull.Value.Equals(dr["notI_precoUnitario"]) ? 0 : Convert.ToDecimal(dr["notI_precoUnitario"]); item.notI_total = DBNull.Value.Equals(dr["notI_total"]) ? 0 : Convert.ToDecimal(dr["notI_total"]); item.notI_tipo = dr["notI_tipo"].ToString(); item.notI_ep = dr["notI_ep"].ToString(); item.notI_tipoReceita = dr["notI_tipoReceita"].ToString(); result.Add(item); } dr.Close(); } return(result); }
List <NTLoteBE> CarregaDados(NTLoteBE obj) { List <NTLoteBE> result = new List <NTLoteBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader(this.procedure, Globais.Helper.TipoSql.Select.ToString(), obj); if (dr.HasRows) { while (dr.Read()) { NTLoteBE item = new NTLoteBE(); item.lote_id = DBNull.Value.Equals(dr["lote_id "]) ? 0 : Convert.ToInt32(dr["lote_id "]); item.log_id = DBNull.Value.Equals(dr["log_id"]) ? 0 : Convert.ToInt32(dr["log_id"]); item.user_id = DBNull.Value.Equals(dr["user_id"]) ? 0 : Convert.ToInt32(dr["user_id"]); item.log_cadastro = Convert.ToDateTime(dr["log_cadastro"]); item.log_alteracao = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_alteracao"]); item.log_exclusao = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_exclusao"]); item.log_ativo = DBNull.Value.Equals(dr["log_ativo"]) ? false : Convert.ToBoolean(dr["log_exclusao"]); item.conf_id = DBNull.Value.Equals(dr["conf_id "]) ? 0 : Convert.ToInt32(dr["conf_id "]); item.lote_serie = dr["lote_serie"].ToString(); item.lote_modulo = dr["lote_modulo"].ToString(); item.lote_emissao = DBNull.Value.Equals(dr["lote_emissao"]) ? default(DateTime) : Convert.ToDateTime(dr["lote_emissao"]); result.Add(item); } dr.Close(); } return(result); }
List <NTNotasBE> CarregaDados(NTNotasBE obj) { List <NTNotasBE> result = new List <NTNotasBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader(this.procedure, Globais.Helper.TipoSql.Select.ToString(), this.conectionString, obj); if (dr.HasRows) { while (dr.Read()) { NTNotasBE item = new NTNotasBE(); item.not_id = DBNull.Value.Equals(dr["not_id"]) ? 0 : Convert.ToInt32(dr["not_id"]); item.log_id = DBNull.Value.Equals(dr["log_id"]) ? 0 : Convert.ToInt32(dr["log_id"]); //item.user_id = DBNull.Value.Equals(dr["user_id"]) ? 0 : Convert.ToInt32(dr["user_id"]); item.log_cadastro = Convert.ToDateTime(dr["log_cadastro"]); item.log_alteracao = DBNull.Value.Equals(dr["log_alteracao"]) ? default(DateTime) : Convert.ToDateTime(dr["log_alteracao"]); item.log_exclusao = DBNull.Value.Equals(dr["log_exclusao"]) ? default(DateTime) : Convert.ToDateTime(dr["log_exclusao"]); item.log_ativo = DBNull.Value.Equals(dr["log_exclusao"]) ? false : Convert.ToBoolean(dr["log_exclusao"]); item.not_numero = DBNull.Value.Equals(dr["not_numero"]) ? 0 : Convert.ToInt32(dr["not_numero"]); item.cli_id = DBNull.Value.Equals(dr["cli_id"]) ? 0 : Convert.ToInt32(dr["cli_id"]); item.cont_id = DBNull.Value.Equals(dr["cont_id"]) ? 0 : Convert.ToInt32(dr["cont_id"]); item.conf_id = DBNull.Value.Equals(dr["conf_id"]) ? 0 : Convert.ToInt32(dr["conf_id"]); item.not_tipoReceita = dr["not_tipoReceita"].ToString(); item.not_codReceita = dr["not_codReceita"].ToString(); item.not_dtEmissao = DBNull.Value.Equals(dr["not_dtEmissao"]) ? default(DateTime) : Convert.ToDateTime(dr["not_dtEmissao"]); item.not_dtVencimento = DBNull.Value.Equals(dr["not_dtVencimento"]) ? default(DateTime) : Convert.ToDateTime(dr["not_dtVencimento"]); item.not_pis = DBNull.Value.Equals(dr["not_pis"]) ? 0 : Convert.ToDecimal(dr["not_pis"]); item.not_confins = DBNull.Value.Equals(dr["not_confins"]) ? 0 : Convert.ToDecimal(dr["not_confins"]); item.not_cssl = DBNull.Value.Equals(dr["not_cssl"]) ? 0 : Convert.ToDecimal(dr["not_cssl"]); item.not_irrf = DBNull.Value.Equals(dr["not_irrf"]) ? 0 : Convert.ToDecimal(dr["not_irrf"]); item.not_totalbruto = DBNull.Value.Equals(dr["not_totalbruto"]) ? 0 : Convert.ToDecimal(dr["not_totalbruto"]); item.not_totalliquido = DBNull.Value.Equals(dr["not_totalliquido"]) ? 0 : Convert.ToDecimal(dr["not_totalliquido"]); item.not_preenchida = DBNull.Value.Equals(dr["not_preenchida"]) ? 0 : Convert.ToInt32(dr["not_preenchida"]); item.not_emitida = DBNull.Value.Equals(dr["not_emitida"]) ? false : Convert.ToBoolean(dr["not_emitida"]); item.not_situacao = dr["not_situacao"].ToString(); item.not_chave = dr["not_chave"].ToString(); result.Add(item); } dr.Close(); } dr.Close(); return(result); }
public List <GlobaisModulosBE> CarregaLista(object obj) { List <GlobaisModulosBE> result = new List <GlobaisModulosBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader("proc_GlobaisModulos", TipoSql.Select.ToString(), obj); if (dr.HasRows) { while (dr.Read()) { GlobaisModulosBE item = new GlobaisModulosBE(); item.Paginas = new List <GlobaisModulosPagesBE>(); item.mod_id = DBNull.Value.Equals(dr["mod_id"]) ? 0 : Convert.ToInt32(dr["mod_id"]); item.mod_image = dr["mod_image"].ToString(); item.mod_nome = dr["mod_nome"].ToString(); item.mod_descricao = dr["mod_descricao"].ToString(); //Log item.log_id = DBNull.Value.Equals(dr["log_id"]) ? 0 : Convert.ToInt32(dr["log_id"]); item.user_id = DBNull.Value.Equals(dr["user_id"]) ? 0 : Convert.ToInt32(dr["user_id"]); item.log_cadastro = Convert.ToDateTime(dr["log_cadastro"]); item.log_alteracao = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_alteracao"]); item.log_exclusao = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_exclusao"]); var xml = dr["page"].ToString(); XmlDocument xm = new XmlDocument(); if (xml != "") { xm.LoadXml(@xml); foreach (XmlElement linha in xm.GetElementsByTagName("row")) { item.Paginas.Add(new GlobaisModulosPagesBE { modPage_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "modPage_id")), mod_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "mod_id")), modPage_nome = Common.ConvertXMLItem(linha, "modPage_nome"), modPage_descricao = Common.ConvertXMLItem(linha, "modPage_descricao"), modPage_icone = Common.ConvertXMLItem(linha, "modPage_icone"), modPage_cadTitulo = Common.ConvertXMLItem(linha, "modPage_cadTitulo"), modPage_url = Common.ConvertXMLItem(linha, "modPage_url"), }); } } result.Add(item); } dr.Close(); } return(result); }
public List <GlobaisPermissaoBE> CarregaPermissaoCompleto(GlobaisPermissaoBE obj) { List <GlobaisPermissaoBE> result = new List <GlobaisPermissaoBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader("proc_GlobaisPermissao", Helper.TipoSql.Select.ToString(), obj); if (dr.HasRows) { while (dr.Read()) { GlobaisPermissaoBE item = new GlobaisPermissaoBE(); item.Paginas = new List <GlobaisPermissaoPaginaBE>(); item.conf_id = DBNull.Value.Equals(dr["conf_id"]) ? 0 : Convert.ToInt32(dr["conf_id"]); item.perm_id = DBNull.Value.Equals(dr["perm_id"])? 0 : Convert.ToInt32(dr["perm_id"]); item.log_id = DBNull.Value.Equals(dr["log_id"]) ? 0 : Convert.ToInt32(dr["log_id"]); item.per_adminisrador = DBNull.Value.Equals(dr["per_adminisrador"]) ? false : Convert.ToBoolean(dr["per_adminisrador"]); item.perm_nome = dr["perm_nome"].ToString(); var xml = dr["pages"].ToString(); XmlDocument xm = new XmlDocument(); if (xml != "") { xm.LoadXml(@xml); foreach (XmlElement linha in xm.GetElementsByTagName("row")) { item.Paginas.Add(new GlobaisPermissaoPaginaBE { permPag_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "permPag_id")), perm_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "perm_id")), permPag_url = Common.ConvertXMLItem(linha, "permPag_url"), permPag_inserir = Common.ConvertXMLItem(linha, "permPag_inserir") == "1" ? true : false, permPag_alterar = Common.ConvertXMLItem(linha, "permPag_alterar") == "1" ? true : false, permPag_excluir = Common.ConvertXMLItem(linha, "permPag_excluir") == "1" ? true : false, }); } } result.Add(item); } } dr.Close(); return(result); }
List <GlobaisClienteBE> CarregaDados(GlobaisClienteBE obj) { List <GlobaisClienteBE> result = new List <GlobaisClienteBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader(this.procedure, Globais.Helper.TipoSql.Select.ToString(), obj); if (dr.HasRows) { while (dr.Read()) { GlobaisClienteBE item = new GlobaisClienteBE(); item.conf_id = DBNull.Value.Equals(dr["conf_id"]) ? 0 : Convert.ToInt32(dr["conf_id"]); item.cli_id = DBNull.Value.Equals(dr["cli_id"]) ? 0 : Convert.ToInt32(dr["cli_id"]); item.usu_id = DBNull.Value.Equals(dr["usu_id"]) ? 0 : Convert.ToInt32(dr["usu_id"]); item.cli_CFOP = DBNull.Value.Equals(dr["cli_CFOP"]) ? 0 : Convert.ToDecimal(dr["cli_CFOP"]); item.cli_SCM = DBNull.Value.Equals(dr["cli_SCM"]) ? false : Convert.ToBoolean(dr["cli_SCM"]); item.cli_MNT = DBNull.Value.Equals(dr["cli_MNT"]) ? false : Convert.ToBoolean(dr["cli_MNT"]); item.cli_tipoVencimento = dr["cli_tipoVencimento"].ToString(); item.cli_parametroVencimento = dr["cli_parametroVencimento"].ToString(); item.cli_nomeFantasia = dr["cli_nomeFantasia"].ToString(); item.cli_razaoSocial = dr["cli_razaoSocial"].ToString(); item.cli_tipoInscricao = dr["cli_tipoInscricao"].ToString(); item.cli_CGC = dr["cli_CGC"].ToString(); item.cli_CPF = dr["cli_CPF"].ToString(); item.cli_CodCidIBGE = dr["cli_CodCidIBGE"].ToString(); item.cli_incricaoEstadual = dr["cli_incricaoEstadual"].ToString(); item.log_id = DBNull.Value.Equals(dr["log_id"]) ? 0 : Convert.ToInt32(dr["log_id"]); item.user_id = DBNull.Value.Equals(dr["user_id"]) ? 0 : Convert.ToInt32(dr["user_id"]); item.log_cadastro = Convert.ToDateTime(dr["log_cadastro"]); item.log_alteracao = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_alteracao"]); item.log_exclusao = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_exclusao"]); result.Add(item); } dr.Close(); } return(result); }
List <NTLoteErroBE> CarregaDados(NTLoteErroBE obj) { List <NTLoteErroBE> result = new List <NTLoteErroBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader(this.procedure, Globais.Helper.TipoSql.Select.ToString(), obj); if (dr.HasRows) { while (dr.Read()) { NTLoteErroBE item = new NTLoteErroBE(); item.LoteErr_id = DBNull.Value.Equals(dr["LoteErr_id "]) ? 0 : Convert.ToInt32(dr["LoteErr_id "]); item.lote_id = DBNull.Value.Equals(dr["lote_id "]) ? 0 : Convert.ToInt32(dr["lote_id "]); item.LoteErr_Codigo = dr["LoteErr_Codigo"].ToString(); item.LoteErr_Mensagem = dr["LoteErr_Mensagem"].ToString(); item.LoteErr_Correcao = dr["LoteErr_Correcao"].ToString(); item.LoteErr_Data = DBNull.Value.Equals(dr["LoteErr_Data"]) ? default(DateTime) : Convert.ToDateTime(dr["LoteErr_Data"]); result.Add(item); } dr.Close(); } return(result); }
List <SCMContratoBE> CarregaContrato(SCMContratoBE obj, string select) { List <SCMContratoBE> result = new List <SCMContratoBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader("proc_SCMContrato", select, GlobaisSCM.ConectionDataBaseGlobal, obj); if (dr.HasRows) { while (dr.Read()) { SCMContratoBE item = new SCMContratoBE(); item.Servicos = new List <SCMClienteServicosBE>(); item.Cliente = new GlobaisClienteBE(); item.cont_id = DBNull.Value.Equals(dr["cont_id"]) ? 0 : Convert.ToInt32(dr["cont_id"]); item.cli_id = DBNull.Value.Equals(dr["cli_id"]) ? 0 : Convert.ToInt32(dr["cli_id"]); item.cont_data = Convert.ToDateTime(dr["cont_data"]); item.conf_id = DBNull.Value.Equals(dr["conf_id"]) ? 0 : Convert.ToInt32(dr["conf_id"]); item.cont_fatura = DBNull.Value.Equals(dr["cont_fatura"]) ? false : Convert.ToBoolean(dr["cont_fatura"]); item.cont_avulso = DBNull.Value.Equals(dr["cont_avulso"]) ? false : Convert.ToBoolean(dr["cont_avulso"]); item.cont_numero = dr["cont_numero"].ToString(); item.cont_nome = dr["cont_nome"].ToString(); item.cont_descricao = dr["cont_descricao"].ToString(); item.log_id = DBNull.Value.Equals(dr["log_id"]) ? 0 : Convert.ToInt32(dr["log_id"]); item.user_id = DBNull.Value.Equals(dr["user_id"]) ? 0 : Convert.ToInt32(dr["user_id"]); item.log_cadastro = Convert.ToDateTime(dr["log_cadastro"]); item.log_alteracao = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_alteracao"]); item.log_exclusao = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_exclusao"]); var xml = dr["servico"].ToString(); XmlDocument xm = new XmlDocument(); if (xml != "") { xm.LoadXml(@xml); foreach (XmlElement linha in xm.GetElementsByTagName("row")) { item.Servicos.Add(new SCMClienteServicosBE { servCli_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "servCli_id")), cli_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "cli_id")), serv_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "serv_id")), cont_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "cont_id")), servCli_nome = Common.ConvertXMLItem(linha, "servCli_nome"), servCli_descricao = Common.ConvertXMLItem(linha, "servCli_descricao"), servCli_valor = Convert.ToDecimal(Common.ConvertXMLItem(linha, "servCli_valor")), servCli_parcelado = Common.ConvertXMLItem(linha, "servCli_parcelado") == "1" ? true : false, servCli_parceladoQtd = Convert.ToInt32(Common.ConvertXMLItem(linha, "servCli_parceladoQtd")), servCli_cobrarPorpor = Convert.ToInt32(Common.ConvertXMLItem(linha, "servCli_cobrarPorpor")), servCli_qtdDias = Convert.ToInt32(Common.ConvertXMLItem(linha, "servCli_qtdDias")), servCli_dataAtivacao = Convert.ToDateTime(Common.ConvertXMLItem(linha, "servCli_dataAtivacao")), servCli_data = Convert.ToDateTime(Common.ConvertXMLItem(linha, "servCli_data")) }); } } result.Add(item); } dr.Close(); } return(result); }
public List <NTNotasEmitidasBE> CarregaNotasEmitidas(NTNotasBE obj, string tipoSelect = "Emitidas") { List <NTNotasEmitidasBE> result = new List <NTNotasEmitidasBE>(); GlobaisClienteDao cliente = new GlobaisClienteDao(); SCMContratoDao contrato = new SCMContratoDao(); SqlDataReader dr = new BaseDados().RetornaDataReader(this.procedure, tipoSelect, this.conectionString, obj); if (dr.HasRows) { while (dr.Read()) { NTNotasEmitidasBE item = new NTNotasEmitidasBE(); item.not_id = DBNull.Value.Equals(dr["not_id"]) ? 0 : Convert.ToInt32(dr["not_id"]); item.log_id = DBNull.Value.Equals(dr["log_id"]) ? 0 : Convert.ToInt32(dr["log_id"]); //item.user_id = DBNull.Value.Equals(dr["user_id"]) ? 0 : Convert.ToInt32(dr["user_id"]); item.log_cadastro = Convert.ToDateTime(dr["log_cadastro"]); item.log_alteracao = DBNull.Value.Equals(dr["log_alteracao"]) ? default(DateTime) : Convert.ToDateTime(dr["log_alteracao"]); item.log_exclusao = DBNull.Value.Equals(dr["log_exclusao"]) ? default(DateTime) : Convert.ToDateTime(dr["log_exclusao"]); item.log_ativo = DBNull.Value.Equals(dr["log_ativo"]) ? false : Convert.ToBoolean(dr["log_ativo"]); item.not_numero = DBNull.Value.Equals(dr["not_numero"]) ? 0 : Convert.ToInt32(dr["not_numero"]); item.cli_id = DBNull.Value.Equals(dr["cli_id"]) ? 0 : Convert.ToInt32(dr["cli_id"]); item.cont_id = DBNull.Value.Equals(dr["cont_id"]) ? 0 : Convert.ToInt32(dr["cont_id"]); item.conf_id = DBNull.Value.Equals(dr["conf_id"]) ? 0 : Convert.ToInt32(dr["conf_id"]); item.not_tipoReceita = dr["not_tipoReceita"].ToString(); item.not_codReceita = dr["not_codReceita"].ToString(); item.not_dtEmissao = DBNull.Value.Equals(dr["not_dtEmissao"]) ? default(DateTime) : Convert.ToDateTime(dr["not_dtEmissao"]); item.not_dtVencimento = DBNull.Value.Equals(dr["not_dtVencimento"]) ? default(DateTime) : Convert.ToDateTime(dr["not_dtVencimento"]); item.not_pis = DBNull.Value.Equals(dr["not_pis"]) ? 0 : Convert.ToDecimal(dr["not_pis"]); item.not_confins = DBNull.Value.Equals(dr["not_confins"]) ? 0 : Convert.ToDecimal(dr["not_confins"]); item.not_cssl = DBNull.Value.Equals(dr["not_cssl"]) ? 0 : Convert.ToDecimal(dr["not_cssl"]); item.not_irrf = DBNull.Value.Equals(dr["not_irrf"]) ? 0 : Convert.ToDecimal(dr["not_irrf"]); item.not_totalbruto = DBNull.Value.Equals(dr["not_totalbruto"]) ? 0 : Convert.ToDecimal(dr["not_totalbruto"]); item.not_totalliquido = DBNull.Value.Equals(dr["not_totalliquido"]) ? 0 : Convert.ToDecimal(dr["not_totalliquido"]); item.not_preenchida = DBNull.Value.Equals(dr["not_preenchida"]) ? 0 : Convert.ToInt32(dr["not_preenchida"]); item.not_emitida = DBNull.Value.Equals(dr["not_emitida"]) ? false : Convert.ToBoolean(dr["not_emitida"]); item.not_situacao = dr["not_situacao"].ToString(); item.not_chave = dr["not_chave"].ToString(); //Lote item.Lote = new NTLoteBE(); item.Lote.lote_serie = dr["lote_serie"].ToString(); item.Lote.lote_modulo = dr["lote_modulo"].ToString(); item.Lote.lote_emissao = DBNull.Value.Equals(dr["lote_emissao"]) ? default(DateTime) : Convert.ToDateTime(dr["lote_emissao"]); //Retorno item.res_id = DBNull.Value.Equals(dr["res_id"]) ? 0 : Convert.ToInt32(dr["res_id"]); item.res_numeroNota = DBNull.Value.Equals(dr["res_numeroNota"]) ? 0 : Convert.ToInt32(dr["res_numeroNota"]); item.res_codigoVerificacao = DBNull.Value.Equals(dr["res_codigoVerificacao"]) ? 0 : Convert.ToInt32(dr["res_codigoVerificacao"]); item.res_dataEmissao = dr["res_dataEmissao"].ToString(); item.Cliente = cliente.CarregaClienteCompleto(new GlobaisClienteBE { cli_id = item.cli_id }).FirstOrDefault <GlobaisClienteBE>(); item.Contrato = contrato.SelectId <SCMContratoBE>(new SCMContratoBE { cont_id = item.cont_id }); result.Add(item); } dr.Close(); } dr.Close(); return(result); }
List <GlobaisEmpresaBE> CarregaDados(GlobaisEmpresaBE obj) { List <GlobaisEmpresaBE> result = new List <GlobaisEmpresaBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader(this.procedure, Globais.Helper.TipoSql.Select.ToString(), obj); GlobaisModulosDao _modulo = new GlobaisModulosDao(); if (dr.HasRows) { while (dr.Read()) { GlobaisEmpresaBE item = new GlobaisEmpresaBE(); item.conf_id = DBNull.Value.Equals(dr["conf_id"]) ? 0 : Convert.ToInt32(dr["conf_id"]); item.end_id = DBNull.Value.Equals(dr["end_id"]) ? 0 : Convert.ToInt32(dr["end_id"]); item.conf_nomefantasia = dr["conf_nomefantasia"].ToString(); item.conf_razaosocial = dr["conf_razaosocial"].ToString(); item.conf_cnpj = dr["conf_cnpj"].ToString(); item.conf_inscricaoestadual = dr["conf_inscricaoestadual"].ToString(); item.conf_telefone = dr["conf_telefone"].ToString(); item.conf_celular = dr["conf_celular"].ToString(); item.conf_celularwhats = DBNull.Value.Equals(dr["conf_celularwhats"]) ? false : Convert.ToBoolean(dr["conf_celularwhats"]); item.conf_email = dr["conf_email"].ToString(); item.conf_dominio = dr["conf_dominio"].ToString(); item.conf_imagempequena = dr["conf_imagempequena"].ToString(); item.conf_imagemgrande = dr["conf_imagemgrande"].ToString(); item.conf_layoutcor = dr["conf_layoutcor"].ToString(); item.end_cep = dr["end_cep"].ToString(); item.end_logradouro = dr["end_logradouro"].ToString(); item.end_numero = dr["end_numero"].ToString(); item.end_complemento = dr["end_complemento"].ToString(); item.end_bairro = dr["end_bairro"].ToString(); item.end_cidade = dr["end_cidade"].ToString(); item.end_estado = dr["end_estado"].ToString(); item.end_latitude = dr["end_latitude"].ToString(); item.end_longetitude = dr["end_longetitude"].ToString(); var xml = dr["modulos"].ToString(); XmlDocument xm = new XmlDocument(); item.Modulos = new List <GlobaisModulosBE>(); if (xml != "") { xm.LoadXml(@xml); foreach (XmlElement linha in xm.GetElementsByTagName("row")) { item.Modulos.Add( _modulo.CarregaLista( new GlobaisModulosBE { mod_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "mod_id")) } ).FirstOrDefault <GlobaisModulosBE>() ); } } result.Add(item); } } dr.Close(); return(result); }
public List <GlobaisClienteBE> CarregaClienteCompleto(GlobaisClienteBE obj) { List <GlobaisClienteBE> result = new List <GlobaisClienteBE>(); SqlDataReader dr = new BaseDados().RetornaDataReader("proc_GlobaisCliente", "cliComp", obj); if (dr.HasRows) { while (dr.Read()) { GlobaisClienteBE item = new GlobaisClienteBE(); item.Endereco = new List <GlobaisClienteEnderecoBE>(); item.Contato = new List <GlobaisClienteContatoBE>(); item.conf_id = DBNull.Value.Equals(dr["conf_id"]) ? 0 : Convert.ToInt32(dr["conf_id"]); item.cli_id = DBNull.Value.Equals(dr["cli_id"])? 0 : Convert.ToInt32(dr["cli_id"]); item.usu_id = DBNull.Value.Equals(dr["usu_id"]) ? 0 : Convert.ToInt32(dr["usu_id"]); item.cli_CFOP = DBNull.Value.Equals(dr["cli_CFOP"]) ? 0 : Convert.ToDecimal(dr["cli_CFOP"]); item.cli_SCM = DBNull.Value.Equals(dr["cli_SCM"])? false : Convert.ToBoolean(dr["cli_SCM"]); item.cli_MNT = DBNull.Value.Equals(dr["cli_MNT"]) ? false : Convert.ToBoolean(dr["cli_MNT"]); item.cli_simplesNacional = DBNull.Value.Equals(dr["cli_simplesNacional"]) ? false : Convert.ToBoolean(dr["cli_simplesNacional"]); item.cli_tipoVencimento = dr["cli_tipoVencimento"].ToString(); item.cli_parametroVencimento = dr["cli_parametroVencimento"].ToString(); item.cli_nomeFantasia = dr["cli_nomeFantasia"].ToString(); item.cli_razaoSocial = dr["cli_razaoSocial"].ToString(); item.cli_tipoInscricao = dr["cli_tipoInscricao"].ToString(); item.cli_CGC = dr["cli_CGC"].ToString(); item.cli_CPF = dr["cli_CPF"].ToString(); item.cli_CodCidIBGE = dr["cli_CodCidIBGE"].ToString(); item.cli_incricaoEstadual = dr["cli_incricaoEstadual"].ToString(); var xml = dr["endereco"].ToString(); XmlDocument xm = new XmlDocument(); if (xml != "") { xm.LoadXml(@xml); foreach (XmlElement linha in xm.GetElementsByTagName("row")) { item.Endereco.Add(new GlobaisClienteEnderecoBE { cliEnd_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "cliEnd_id")), cliEnd_Tipo = Common.ConvertXMLItem(linha, "cliEnd_Tipo"), cli_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "cli_id")), end_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "end_id")), end_cep = Common.ConvertXMLItem(linha, "end_cep"), end_logradouro = Common.ConvertXMLItem(linha, "end_logradouro"), end_numero = Common.ConvertXMLItem(linha, "end_numero"), end_complemento = Common.ConvertXMLItem(linha, "end_complemento"), end_bairro = Common.ConvertXMLItem(linha, "end_bairro"), end_cidade = Common.ConvertXMLItem(linha, "end_cidade"), end_estado = Common.ConvertXMLItem(linha, "end_estado"), end_latitude = Common.ConvertXMLItem(linha, "end_latitude"), end_longetitude = Common.ConvertXMLItem(linha, "end_longetitude"), }); } } xml = dr["contato"].ToString(); if (xml != "") { XmlDocument xm1 = new XmlDocument(); xm1.LoadXml(@xml); foreach (XmlElement linha in xm1.GetElementsByTagName("row")) { item.Contato.Add(new GlobaisClienteContatoBE { cont_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "cont_id")), cli_id = Convert.ToInt32(Common.ConvertXMLItem(linha, "cli_id")), cont_nome = Common.ConvertXMLItem(linha, "cont_nome"), cont_ddd = Common.ConvertXMLItem(linha, "cont_fone"), cont_fone = Common.ConvertXMLItem(linha, "cont_fone"), cont_departamento = Common.ConvertXMLItem(linha, "cont_departamento"), cont_email = Common.ConvertXMLItem(linha, "cont_email"), }); } } result.Add(item); } dr.Close(); } return(result); }