public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_nomeEmpresa "); /// USER [ execute ] while (emp.fetch()) { // ## Copia dados de empresas com nome DadosEmpresa de = new DadosEmpresa(); de.set_st_fantasia(emp.get_st_fantasia()); de.set_st_empresa(emp.get_st_empresa()); output_array_generic_lst.Add(de); } /// USER [ execute ] END Registry("execute done fetch_nomeEmpresa "); return(true); }
public void recv_fetch_dadosEmpresa(ref DadosEmpresa de) { DataPortable recv_dp_cont_de = new DataPortable(); m_Comm.GetExitPortableAtPosition(0).GetMapContainer(COMM_OUT_FETCH_DADOSEMPRESA.de, ref recv_dp_cont_de); de.Import(recv_dp_cont_de); }
/// USER [ custom_functions ] /// USER [ custom_functions ] END public bool Item1() { #region - INPUT VARS - transaction.MemoryClean(); tst_unit.LogTest("exec_alteraEmpresa Item1", ref m_Log); transaction.ut_abort = 0; DadosEmpresa de = new DadosEmpresa(); CNetHeader header = new CNetHeader(); #endregion /// USER [ setup_test_1 ] /// USER [ setup_test_1 ] END #region - MAPPING TRANSACTION - call_exec_alteraEmpresa(ref de, ref header); if (transaction.setup() == false) { return(false); } try { #endregion /// USER [ execute_1 ] /// USER [ execute_1 ] END #region - OUTPUT VARS - } catch (System.Exception se) { if (se.Message != "ABORT") { MessageBox.Show(se.ToString()); } } if (transaction.finish() == false) { return(false); } transaction.sendObjections(ref my_objections); #endregion /// USER [ validate_1 ] /// USER [ validate_1 ] END return(true); }
public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_listaConveniosLoja "); /// USER [ execute ] // ## Obtem empresas vinculadas à loja LINK_LojaEmpresa loj_emp = new LINK_LojaEmpresa(this); if (loj_emp.select_fk_loja(loj.get_identity())) { T_Empresa emp = new T_Empresa(this); while (loj_emp.fetch()) { // ## Busca empresa if (!emp.selectIdentity(loj_emp.get_fk_empresa())) { return(false); } // ## Copiar dados DadosEmpresa de = new DadosEmpresa(); de.set_st_empresa(emp.get_st_empresa()); de.set_st_fantasia(emp.get_st_fantasia()); de.set_tx_convenio(loj_emp.get_tx_admin()); de.set_nu_dias_convenio(loj_emp.get_nu_dias_repasse()); de.set_st_ag(loj_emp.get_st_ag()); de.set_st_banco(loj_emp.get_st_banco()); de.set_st_conta(loj_emp.get_st_conta()); output_array_generic_lst.Add(de); } } if (output_array_generic_lst.Count == 0) { PublishNote("Nenhum convênio disponível"); } /// USER [ execute ] END Registry("execute done fetch_listaConveniosLoja "); return(true); }
public void call_exec_alteraEmpresa(ref DadosEmpresa de, ref CNetHeader header) { m_Comm.Clear(); DataPortable send_dp_cont_0 = new DataPortable(); DataPortable send_dp_cont_1 = new DataPortable(); send_dp_cont_0.MapTagContainer(COMM_IN_EXEC_ALTERAEMPRESA.de, de as DataPortable); send_dp_cont_1.MapTagContainer(COMM_IN_EXEC_ALTERAEMPRESA.header, header as DataPortable); m_Comm.AddEntryPortable(ref send_dp_cont_0); m_Comm.AddEntryPortable(ref send_dp_cont_1); }
public override bool execute( ) { Registry("execute fetch_listawebConveniosLoja "); /// USER [ execute ] T_Loja loj = new T_Loja(this); if (!loj.select_rows_loja(input_st_loja)) { PublishError("Cnpj não disponível"); return(false); } if (!loj.fetch()) { return(false); } if (loj.get_st_senha() != input_st_senha) { PublishError("Senha inválida"); return(false); } LINK_LojaEmpresa lnk = new LINK_LojaEmpresa(this); T_Empresa emp = new T_Empresa(this); if (lnk.select_fk_loja(loj.get_identity())) { while (lnk.fetch()) { if (!emp.selectIdentity(lnk.get_fk_empresa())) { continue; } DadosEmpresa de = new DadosEmpresa(); de.set_st_empresa(emp.get_st_empresa()); output_array_generic_lst.Add(de); } } /// USER [ execute ] END Registry("execute done fetch_listawebConveniosLoja "); return(true); }
public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_listaEmpresas "); /// USER [ execute ] T_Empresa m_emp = new T_Empresa(this); for (int t = 0; t < var_util.indexCSV(input_st_csv_empresas); ++t) { if (!m_emp.fetch_rows_empresa(var_util.getCSV(t))) { return(false); } if (!m_emp.fetch()) { return(false); } LINK_LojaEmpresa loj_emp = new LINK_LojaEmpresa(this); loj_emp.fetch_fk_empresa_geral(m_emp.get_identity()); DadosEmpresa de = new DadosEmpresa(); de.set_nu_CNPJ(m_emp.get_nu_CNPJ()); de.set_st_empresa(m_emp.get_st_empresa()); de.set_st_fantasia(m_emp.get_st_fantasia()); de.set_st_cidade(m_emp.get_st_cidade()); de.set_st_estado(m_emp.get_st_estado()); de.set_nu_cartoes(m_emp.get_nu_cartoes()); de.set_nu_parcelas(m_emp.get_nu_parcelas()); de.set_vr_taxa(m_emp.get_vr_taxa()); de.set_nu_lojas(loj_emp.RowCount().ToString()); output_array_generic_lst.Add(de); } /// USER [ execute ] END Registry("execute done fetch_listaEmpresas "); return(true); }
public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_empresasGrafica "); /// USER [ execute ] T_Cartao cart = new T_Cartao(this); T_Empresa emp = new T_Empresa(this); if (emp.selectAll()) { while (emp.fetch()) { bool Found = false; if (cart.select_rows_empresa(emp.get_st_empresa())) { while (cart.fetch()) { if (cart.get_tg_emitido() == StatusExpedicao.NaoExpedido) { Found = true; break; } } } if (Found) { DadosEmpresa de = new DadosEmpresa(); de.set_st_empresa(emp.get_st_empresa()); de.set_st_fantasia(emp.get_st_fantasia()); output_array_generic_lst.Add(de); } } } /// USER [ execute ] END Registry("execute done fetch_empresasGrafica "); return(true); }
public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_listaFiliais "); /// USER [ execute ] T_Empresa emp = new T_Empresa(this); if (!emp.select_rows_empresa(input_cont_header.get_st_empresa())) { PublishError("Nenhuma empresa com o código '" + input_cont_header.get_st_empresa() + "'"); return(false); } if (!emp.fetch()) { return(false); } if (!emp.select_fk_admin(emp.get_identity())) { PublishError("Nenhuma empresa afiliada encontrada!"); return(false); } while (emp.fetch()) { // ## Copia dados de empresas com nome DadosEmpresa de = new DadosEmpresa(); de.set_st_fantasia(emp.get_st_fantasia()); de.set_st_empresa(emp.get_st_empresa()); output_array_generic_lst.Add(de); } /// USER [ execute ] END Registry("execute done fetch_listaFiliais "); return(true); }
public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_empresasAfiliadas "); /// USER [ execute ] T_Empresa emp = new T_Empresa(this); if (!emp.select_rows_empresa(input_st_empresa.PadLeft(6, '0'))) { PublishError("Empresa não disponível"); return(false); } if (!emp.fetch()) { return(false); } output_st_nome_emp = emp.get_st_fantasia(); T_EmpresaAfiliada emp_aff = new T_EmpresaAfiliada(this); if (emp_aff.select_fk_empresa(emp.get_identity())) { while (emp_aff.fetch()) { DadosEmpresa de = new DadosEmpresa(); de.set_st_empresa(emp_aff.get_st_nome()); output_array_generic_lst.Add(de); } } /// USER [ execute ] END Registry("execute done fetch_empresasAfiliadas "); return(true); }
public override bool execute ( ) { if ( base.execute() == false) return false; Registry ( "execute fetch_lojistaEmpresas " ); /// USER [ execute ] T_Loja loj = new T_Loja (this); if ( !loj.select_rows_loja ( input_st_loja ) ) { PublishError ( "Loja não encontrada" ); return false; } if ( !loj.fetch() ) return false; T_Empresa emp = new T_Empresa (this); LINK_LojaEmpresa loj_emp = new LINK_LojaEmpresa (this); if ( loj_emp.select_fk_loja ( loj.get_identity() ) ) { while ( loj_emp.fetch() ) { if ( !emp.selectIdentity ( loj_emp.get_fk_empresa() ) ) return false; DadosEmpresa de = new DadosEmpresa(); de.set_st_empresa ( emp.get_st_empresa() ); de.set_st_fantasia ( emp.get_st_fantasia() ); output_array_generic_lst.Add ( de ); } } /// USER [ execute ] END Registry ( "execute done fetch_lojistaEmpresas " ); return true; }
public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_rel_tarifas "); /// USER [ execute ] StringBuilder sb_emp = new StringBuilder(); StringBuilder sb_content = new StringBuilder(); money mon_help = new money(); T_Empresa emp = new T_Empresa(this); emp.select_rows_tarifas(); while (emp.fetch()) { DadosEmpresa de = new DadosEmpresa(); de.set_st_fantasia("(E) " + emp.get_st_empresa() + " " + emp.get_st_fantasia()); DataPortable tmp = de as DataPortable; sb_emp.Append(MemorySave(ref tmp)); sb_emp.Append(","); { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Empresa" ); rt.set_st_val(emp.get_st_fantasia()); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Mensalidade" ); rt.set_st_val(mon_help.formatToMoney(emp.get_vr_mensalidade())); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Percentual sobre transação" ); string pct = emp.get_nu_pctValor().PadLeft(3, '0'); pct = pct.Insert(pct.Length - 2, ",") + "%"; rt.set_st_val(pct); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Valor transação" ); rt.set_st_val(mon_help.formatToMoney(emp.get_vr_transacao())); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Valor mínimo" ); rt.set_st_val(mon_help.formatToMoney(emp.get_vr_minimo())); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Franquia de transações" ); rt.set_st_val(emp.get_nu_franquia()); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Valor por cartão ativo" ); rt.set_st_val(mon_help.formatToMoney(emp.get_vr_cartaoAtivo())); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Isento de Fatura" ); if (emp.get_tg_isentoFat() == Context.TRUE) { rt.set_st_val("SIM"); } else { rt.set_st_val("NÃO"); } DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Situação" ); if (emp.get_tg_blocked() == Context.TRUE) { rt.set_st_val("Bloq."); } else { rt.set_st_val("Ativo"); } DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } } T_Loja loj = new T_Loja(this); loj.select_rows_tarifas(); while (loj.fetch()) { DadosEmpresa de = new DadosEmpresa(); string id = "(" + loj.get_st_loja() + ") CNPJ: " + loj.get_nu_CNPJ() + " " + loj.get_st_nome() + " - " + loj.get_st_social(); de.set_st_fantasia(id); DataPortable tmp = de as DataPortable; sb_emp.Append(MemorySave(ref tmp)); sb_emp.Append(","); { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Empresa" ); rt.set_st_val(id); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(id); //rt.set_st_desc ( "Mensalidade" ); rt.set_st_val(mon_help.formatToMoney(loj.get_vr_mensalidade())); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(id); //rt.set_st_desc ( "Percentual sobre transação" ); string pct = loj.get_nu_pctValor().PadLeft(3, '0'); pct = pct.Insert(pct.Length - 2, ",") + "%"; rt.set_st_val(pct); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(id); //rt.set_st_desc ( "Valor transação" ); rt.set_st_val(mon_help.formatToMoney(loj.get_vr_transacao())); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(id); //rt.set_st_desc ( "Valor mínimo" ); rt.set_st_val(mon_help.formatToMoney(loj.get_vr_minimo())); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(id); //rt.set_st_desc ( "Franquia de transações" ); rt.set_st_val(loj.get_nu_franquia()); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Valor por cartão ativo" ); rt.set_st_val("0"); DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(id); //rt.set_st_desc ( "Isento de Fatura" ); if (loj.get_tg_isentoFat() == Context.TRUE) { rt.set_st_val("SIM"); } else { rt.set_st_val("NÃO"); } DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } { Rel_Tarifas rt = new Rel_Tarifas(); rt.set_st_emp(de.get_st_fantasia()); //rt.set_st_desc ( "Situação" ); if (loj.get_tg_blocked() == Context.TRUE) { rt.set_st_val("Bloq."); } else { rt.set_st_val("Ativo"); } if (loj.get_tg_cancel() == Context.TRUE) { rt.set_st_val("Cancel."); } DataPortable port_rt = rt as DataPortable; sb_content.Append(MemorySave(ref port_rt)); sb_content.Append(","); } } // content { string list_ids = sb_content.ToString().TrimEnd(','); DataPortable dp = new DataPortable(); dp.setValue("ids", list_ids); output_st_csv = MemorySave(ref dp); } // entidades { string list_ids = sb_emp.ToString().TrimEnd(','); DataPortable dp = new DataPortable(); dp.setValue("ids", list_ids); output_st_csv_emp = MemorySave(ref dp); } /// USER [ execute ] END Registry("execute done fetch_rel_tarifas "); return(true); }
public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_dadosAdministradora "); /// USER [ execute ] T_Empresa emp = new T_Empresa(this); // ## Busca empresa if (!emp.select_rows_empresa(input_st_empresa)) { PublishError("Empresa inválida"); return(false); } if (!emp.fetch()) { return(false); } // ## Obtem chave da empresa principal string fk_admin = emp.get_identity(); // ## Busca todas as empresas if (!emp.selectAll()) { PublishError("Nenhuma empresa cadastrada"); return(false); } // ## Dois grupos, um das empresas vinculadas // ## e outro de não vinculadas StringBuilder sb_in = new StringBuilder(); StringBuilder sb_out = new StringBuilder(); // ## Busca registros while (emp.fetch()) { // ## Empresa admin deve ser filtrada if (emp.get_identity() == fk_admin) { continue; } // ## Copia para memória DadosEmpresa de = new DadosEmpresa(); de.set_st_fantasia(emp.get_st_fantasia()); de.set_st_empresa(emp.get_st_empresa()); DataPortable port = de as DataPortable; // ## Caso link para admin bater com admin // ## esta empresa é vinculada if (emp.get_fk_admin() == fk_admin) { // ## obtem indexador sb_in.Append(MemorySave(ref port)); sb_in.Append(","); } else { // ## obtem indexador sb_out.Append(MemorySave(ref port)); sb_out.Append(","); } } // in { string list_ids = sb_in.ToString().TrimEnd(','); DataPortable dp = new DataPortable(); dp.setValue("ids", list_ids); // ## obtem indexador de grupo output_st_in_csv = MemorySave(ref dp); } // out { string list_ids = sb_out.ToString().TrimEnd(','); DataPortable dp = new DataPortable(); dp.setValue("ids", list_ids); // ## obtem indexador de grupo output_st_out_csv = MemorySave(ref dp); } /// USER [ execute ] END Registry("execute done fetch_dadosAdministradora "); return(true); }
public override bool execute( ) { if (base.execute() == false) { return(false); } Registry("execute fetch_consultaEmpresa "); /// USER [ execute ] StringBuilder sb = new StringBuilder(); string nome = input_cont_dce.get_st_nome(), cidade = input_cont_dce.get_st_cidade(), estado = input_cont_dce.get_st_estado(); long vr_min = 0, vr_max = 0, qtd_cart = 0, qtd_parc = 0, nu_lojas = 0, val = 0; // ## Prepara filtros if (input_cont_dce.get_nu_cartoes().Length > 0) { qtd_cart = Convert.ToInt32(input_cont_dce.get_nu_cartoes()); } if (input_cont_dce.get_nu_parcelas().Length > 0) { qtd_parc = Convert.ToInt32(input_cont_dce.get_nu_parcelas()); } if (input_cont_dce.get_nu_lojas().Length > 0) { nu_lojas = Convert.ToInt32(input_cont_dce.get_nu_lojas()); } if (input_cont_dce.get_vr_taxa_min().Length > 0) { vr_min = Convert.ToInt32(input_cont_dce.get_vr_taxa_min()); } if (input_cont_dce.get_vr_taxa_min().Length > 0) { vr_max = Convert.ToInt32(input_cont_dce.get_vr_taxa_max()); } LINK_LojaEmpresa loj_emp = new LINK_LojaEmpresa(this); // ## Busca todos os registros nome = nome.ToUpper(); while (emp.fetch()) { val = emp.get_int_vr_mensalidade(); if (vr_min > 0) { if (val < vr_min) { continue; } } if (vr_max > 0) { if (val > vr_max) { continue; } } if (vr_min > 0 && vr_max > 0) { if (val < vr_min || val > vr_max) { continue; } } if (qtd_cart > 0) { if (emp.get_int_nu_cartoes() < qtd_cart) { continue; } } if (qtd_parc > 0) { if (emp.get_int_nu_parcelas() < qtd_parc) { continue; } } if (nome.Length > 0) { if (!emp.get_st_social().ToUpper().Contains(nome)) { if (!emp.get_st_fantasia().ToUpper().Contains(nome)) { continue; } } } if (cidade.Length > 0) { if (!emp.get_st_cidade().Contains(cidade)) { continue; } } if (estado.Length > 0) { if (!emp.get_st_estado().Contains(estado)) { continue; } } // ## Contabiliza numero de lojas loj_emp.SetCountMode(); loj_emp.select_fk_empresa_geral(emp.get_identity()); if (input_cont_dce.get_nu_lojas().Length > 0) { if (loj_emp.GetCount() < nu_lojas) { continue; } } // ## Copia dados para memória DadosEmpresa de = new DadosEmpresa(); de.set_nu_lojas(loj_emp.GetCount().ToString()); de.set_st_empresa(emp.get_st_empresa()); de.set_st_fantasia(emp.get_st_fantasia().Trim() + " - " + emp.get_st_social().Trim()); de.set_st_cidade(emp.get_st_cidade()); de.set_st_estado(emp.get_st_estado()); de.set_nu_cartoes(emp.get_nu_cartoes()); de.set_nu_parcelas(emp.get_nu_parcelas()); de.set_vr_mensalidade(emp.get_vr_mensalidade()); de.set_nu_CNPJ(emp.get_nu_CNPJ()); de.set_tg_bloq(emp.get_tg_bloq()); DataPortable tmp = de as DataPortable; // ## indexa em CSV sb.Append(MemorySave(ref tmp)); sb.Append(","); } string list_ids = sb.ToString().TrimEnd(','); if (list_ids == "") { PublishNote("Nenhum resultado foi encontrado"); return(true); } DataPortable dp = new DataPortable(); dp.setValue("ids", list_ids); // ## Obtem identificador de bloco output_st_csv_empresas = MemorySave(ref dp); /// USER [ execute ] END Registry("execute done fetch_consultaEmpresa "); return(true); }