Exemplo n.º 1
0
    protected void Page_Init(object sender, EventArgs e)  // CARGA DOS LOOKUPS TEM QUE SER FEITA NESTE EVENTO  ====================================================================================
    {
        login_usuario = Convert.ToString(Session["usuario"]);
        lImprime      = true; //SreDbLib.TemPermissao("001.070.080.001", (String)Session["CodUsuario"]);

        // CARGA DE UM LOOKUP  ===============================================================================================================================================
        // lookupcliente
        dsclientes = uContato.LookUpContato();   // Método que retorna o dataset com os campos pro lookup
        lookupcliente.DataSource   = dsclientes;
        lookupcliente.KeyFieldName = "apelido";  // Campo Chave no dataset retornado
        lookupcliente.DataBind();
        //
        // LookUpMala
        dscartas = uMalaDireta.LookUpMala(); // Método que retorna o dataset com os campos pro lookup
        lookupcartas.DataSource   = dscartas;
        lookupcartas.KeyFieldName = "nome";  // Campo Chave no dataset retornado
        lookupcartas.DataBind();
        //
        uProduto.MontaComboProduto(cbproduto, true);
        //
        Srelib.MontaComboMes(cbmes, true);
        //
        dtprevisao1.Date = Convert.ToDateTime("01/01/1900");
        //
        // FIM CARGA DE UM LOOKUP  ===============================================================================================================================================
    }
Exemplo n.º 2
0
    public static String Grava(string xcodigo,
                               string xcod_banco,
                               string xcod_agencia,
                               string xcod_conta,
                               string xnome_agencia,
                               string xcidade,
                               string xuf,
                               string xcep,
                               string xlimite_cheque,
                               string xconta_contabil,
                               string xcomplemento,
                               string xcombo)
    {
        if (xcod_banco != String.Empty)
        {
            string script = "INSERT INTO CONTAS VALUES ( " +
                            Srelib.QStr(xcodigo) +
                            ", " + Srelib.QStr(xcod_banco) +
                            ", " + Srelib.QStr(xcod_agencia) +
                            ", " + Srelib.QStr(xcod_conta) +
                            ", " + Srelib.QStr(xnome_agencia) +
                            ", " + Srelib.QStr(xcidade) +
                            ", " + Srelib.QStr(xuf) +
                            ", " + Srelib.QStr(xcep) +
                            ", " + Srelib.forcaponto(xlimite_cheque) +
                            ", " + Srelib.QStr(xconta_contabil) +
                            ", " + Srelib.QStr(xcomplemento) +
                            ", " + xcombo +
                            " ) ";

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Exemplo n.º 3
0
    public static String PegaMensagens(string xID,
                                       ref string msg1,
                                       ref string msg2,
                                       ref string msg3,
                                       ref string msg4,
                                       ref string msg5)
    {
        DataSet ds;

        string script = "select * from boleto_mensagens " +
                        " with(nolock) " +
                        " where codigo = " + xID;
        string retorno = "";

        ds = SreDblib.GetDsScript(script);

        try
        {
            msg1 = ds.Tables[0].Rows[0]["linha1"].ToString().Trim() + Srelib.replicate(" ", 80);
            msg2 = ds.Tables[0].Rows[0]["linha2"].ToString().Trim() + Srelib.replicate(" ", 80);
            msg3 = ds.Tables[0].Rows[0]["linha3"].ToString().Trim() + Srelib.replicate(" ", 80);
            msg4 = ds.Tables[0].Rows[0]["linha4"].ToString().Trim() + Srelib.replicate(" ", 80);
            msg5 = ds.Tables[0].Rows[0]["linha5"].ToString().Trim() + Srelib.replicate(" ", 80);
        }
        catch (Exception)
        {
            retorno = "";
        }


        return(retorno);
    }
Exemplo n.º 4
0
    public static String AlteraConta(string xID,
                                     string xcod_banco,
                                     string xcod_agencia,
                                     string xcod_conta,
                                     string xnome_agencia,
                                     string xcidade,
                                     string xuf,
                                     string xcep,
                                     string xlimite_cheque,
                                     string xconta_contabil,
                                     string xcomplemento,
                                     string xcombo)
    {
        string script = "UPDATE CONTAS SET " +
                        " cod_banco = " + Srelib.QStr(xcod_banco) +
                        " ,cod_agencia = " + Srelib.QStr(xcod_agencia) +
                        " ,cod_conta = " + Srelib.QStr(xcod_conta) +
                        " ,nome_agencia = " + Srelib.QStr(xnome_agencia) +
                        " ,cidade = " + Srelib.QStr(xcidade) +
                        " ,uf = " + Srelib.QStr(xuf) +
                        " ,cep = " + Srelib.QStr(xcep) +
                        " ,limite_cheque = " + Srelib.forcaponto(xlimite_cheque) +
                        " ,conta_contabil = " + Srelib.QStr(xconta_contabil) +
                        " ,complemento = " + Srelib.QStr(xcomplemento) +
                        " ,combo = " + Srelib.QStr(xcombo) +
                        " where ID =" + xID;

        //revisar quando mexer na cobrança bancária

        SreDblib.ExecScript(script);

        return(" ");
    }
Exemplo n.º 5
0
    public static String PegaSaldoFinalDataAnterior(string xcodigo_conta,
                                                    DateTime xdata,
                                                    ref string xsaldo_f,
                                                    ref string xsaldo_aplicacaoD,
                                                    ref string xsaldo_aplicacaoB)
    {
        //
        DataSet ds;
        string  script = "select TOP 1 * from conta_" + Srelib.QStr0(xcodigo_conta.Trim(), 5) +
                         " with(nolock) " +
                         " Where " +
                         " data < " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xdata).Substring(0, 10))) +
                         " order by ID DESC ";

        ds = SreDblib.GetDsScript(script);
        //
        if (ds.Tables[0].Rows.Count > 0)
        {
            //Faz caso exista lançamentos anteriores a data
            //
            xsaldo_f          = ds.Tables[0].Rows[0]["saldo_f"].ToString().Trim();
            xsaldo_aplicacaoD = ds.Tables[0].Rows[0]["saldo_aplicacaoD"].ToString().Trim();
            xsaldo_aplicacaoB = ds.Tables[0].Rows[0]["saldo_aplicacaoB"].ToString().Trim();
        }
        else
        {
            //
            xsaldo_f          = uContas.PegaSaldoInicial(xcodigo_conta);
            xsaldo_aplicacaoD = uContas.PegaSaldoInicialsaldo_aplicacaoD(xcodigo_conta);
            xsaldo_aplicacaoB = uContas.PegaSaldoInicialsaldo_aplicacaoB(xcodigo_conta);
        }
        return("");
    }
    private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
    {
        string TipoEndereco = Convert.ToString(GetCurrentColumnValue("endereco"));

        if (TipoEndereco == "R")
        {
            lendereco.Text = "Res: " + Convert.ToString(GetCurrentColumnValue("enderecores"));
            lbairro.Text   = Convert.ToString(GetCurrentColumnValue("bairrores"));
            lcidade.Text   = Convert.ToString(GetCurrentColumnValue("cidaderes"));
            luf.Text       = Convert.ToString(GetCurrentColumnValue("ufres"));
            lcep.Text      = Convert.ToString(GetCurrentColumnValue("cepres"));
            lcnpj.Text     = Srelib.FormataCPFCNPJ(Convert.ToString(GetCurrentColumnValue("cnpj")));
            lfone.Text     = Convert.ToString(GetCurrentColumnValue("fone1res"));
        }
        else
        {
            lendereco.Text = "Com: " + Convert.ToString(GetCurrentColumnValue("enderecocom"));
            lbairro.Text   = Convert.ToString(GetCurrentColumnValue("bairrocom"));
            lcidade.Text   = Convert.ToString(GetCurrentColumnValue("cidadecom"));
            luf.Text       = Convert.ToString(GetCurrentColumnValue("ufcom"));
            lcep.Text      = Convert.ToString(GetCurrentColumnValue("cepcom"));
            lcnpj.Text     = Srelib.FormataCPFCNPJ(Convert.ToString(GetCurrentColumnValue("cnpj")));
            lfone.Text     = Convert.ToString(GetCurrentColumnValue("fone1com"));
        }
        totquantidade++;
    }
Exemplo n.º 7
0
    public static DataSet PegaDadosTaxasMensaisNome(String xNome, DateTime xPrevisao1, DateTime xPrevisao2)
    {
        string script;

        if (xNome == "")
        {
            script = " SELECT * FROM taxas_mensais WITH(NOLOCK) " +
                     " WHERE (Convert(DateTime," + Srelib.QStr("01/") + "+mes+" + Srelib.QStr("/") + "+ano,103) " +
                     " between " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao1))) +
                     " and " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao2))) + ") " +
                     " order by " +
                     "REPLICATE('0', 4 - LEN(ano)) + CAST(ano AS varchar), " +
                     "REPLICATE('0', 2 - LEN(mes)) + CAST(mes AS varchar) ";
        }
        else
        {
            script = "SELECT mes, ano, " + xNome + " FROM taxas_mensais WITH(NOLOCK) " +
                     " WHERE (Convert(DateTime," + Srelib.QStr("01/") + "+mes+" + Srelib.QStr("/") + "+ano,103) " +
                     " between " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao1))) +
                     " and " + Srelib.QStr(Srelib.DataAmericanasembarra(Convert.ToString(xPrevisao2))) + ") " +
                     " order by " +
                     "REPLICATE('0', 4 - LEN(ano)) + CAST(ano AS varchar), " +
                     "REPLICATE('0', 2 - LEN(mes)) + CAST(mes AS varchar) ";
        }

        return(SreDblib.GetDsScript(script));
    }
Exemplo n.º 8
0
    public static DataSet PegaDadosLogradouro2014(string xendereco, string xuf, Boolean xcepespecial)
    {
        string script = "";

        if (xendereco != String.Empty)
        {
            if (!xcepespecial)
            {
                script = "select l.*, l.ufe_sg UF, " +
                         " (select c.loc_nosub from log_localidade c where c.loc_nu_sequencial = l.loc_nu_sequencial ) Cidade " +
                         " from log_logradouro l where l.endereco like " + Srelib.QStr("%" + xendereco + "%");
                if (xuf != String.Empty)
                {
                    script = script + " and l.ufe_sg = " + Srelib.QStr(xuf);
                }
                script = script + " order by UF, Cidade";
            }
            else
            {
                script = " select l.*, l.ufe_sg UF, " +
                         " (select c.loc_nosub from log_localidade c where c.loc_nu_sequencial = l.loc_nu_sequencial ) Cidade " +
                         " from log_grande_usuario l where l.endereco like " + Srelib.QStr("%" + xendereco + "%");
                if (xuf != String.Empty)
                {
                    script = script + " and l.ufe_sg = " + Srelib.QStr(xuf);
                }
                script = script + " order by UF, Cidade";
            }
            return(SreDblib.GetDsScriptCep(script));
        }
        else
        {
            return(null);
        }
    }
Exemplo n.º 9
0
    public static DataSet PegaDadosCep2007(string xcep, Boolean xcepespecial)
    {
        string script = "";

        if (xcep != String.Empty)
        {
            if (!xcepespecial)
            {
                script = "select l.*, " +
                         " (select c.Cidade from localidades c where c.id = l.CodLoc ) Cidade, " +
                         " (select c.UF from localidades c where c.id = l.CodLoc ) UF " +
                         " from logradouros l where l.cep = " + Srelib.QStr(xcep) +
                         " order by UF, Cidade";
            }
            else
            {
                script = "select l.*, l.nome Complemento, " +
                         " (select c.Cidade from localidades c where c.id = l.CodLoc ) Cidade, " +
                         " (select c.UF from localidades c where c.id = l.CodLoc ) UF " +
                         " from especiais l where l.cep = " + Srelib.QStr(xcep) +
                         " order by UF, Cidade";
            }
            return(SreDblib.GetDsScriptCep(script));
        }
        else
        {
            return(null);
        }
    }
Exemplo n.º 10
0
    public DataSet PegaGerentes(Usuario xUsuario, String cGerente, Boolean lMaster, String pXml)
    {
        // Conexao Conn = new Conexao(pXml);

        String Qry;

        String cMaster = "0";

        if (lMaster)
        {
            cMaster = "1";
        }

        Qry = "SELEC_GERENTES " +
              xUsuario.CodUsuario + "," +
              Srelib.QStr(cGerente) + "," +
              cMaster;

        DS = new DataSet();
        SqlCommand Command = new SqlCommand(Qry, DM.ConexaoSessao);

        Command.CommandTimeout = 99999;
        SqlDataAdapter DA = new SqlDataAdapter();

        DA.TableMappings.Add("Table", "CRTOTCED1");
        DA.SelectCommand = Command;

        DA.Fill(DS);

        // Conn.SqlConn.Close();

        return(DS);
    }
Exemplo n.º 11
0
    public void AutenticaEmail(string wempresa, ref bool wckemail, ref bool wckssl, ref string wsmtpporta, ref string wlogin, ref string wsenha, ref bool wcktls)
    {
        String script = "SELECT ckemail, ckssl, smtpporta, login, senha, cktls " +
                        "FROM empresa WITH(NOLOCK) " +
                        "WHERE apelido = " + Srelib.QStr(wempresa);
        DataSet ds = SreDblib.GetDsScript(script);


        if (ds.Tables[0].Rows.Count == 0)
        {
            wckemail   = false;
            wsmtpporta = "";
            wlogin     = "";
            wsenha     = "";
            wckssl     = false;
            wcktls     = false;
        }
        else
        {
            wckemail   = Convert.ToBoolean(ds.Tables[0].Rows[0]["ckemail"].ToString());
            wckssl     = Convert.ToBoolean(ds.Tables[0].Rows[0]["ckssl"].ToString());
            wcktls     = Convert.ToBoolean(ds.Tables[0].Rows[0]["cktls"].ToString());
            wsmtpporta = ds.Tables[0].Rows[0]["smtpporta"].ToString();
            wlogin     = ds.Tables[0].Rows[0]["login"].ToString();
            wsenha     = ds.Tables[0].Rows[0]["senha"].ToString();
        }
        ds.Clear();
    }
Exemplo n.º 12
0
    public static String Exclui(string xID, string xnome, string xperiodicidade)
    {
        //Indexadores
        string script = "";

        script = " DELETE FROM INDEXADORES " +
                 " WHERE NOT EXISTS (SELECT 1 FROM VENDAS " +
                 " WHERE indexador  = " + Srelib.QStr(xnome.ToUpper()) + " ) and nome = " + Srelib.QStr(xnome.ToUpper()) + " ";
        SreDblib.ExecScript(script);
        //
        //Campo
        if (xperiodicidade == "DIARIA")
        {
            script = "if not exists(select 1 from vendas where indexador = " + Srelib.QStr(xnome.ToUpper()) + ") " +
                     " ALTER TABLE TAXAS_DIARIAS " +
                     " DROP COLUMN [" + xnome.ToUpper() + "]";
        }
        else
        {
            script = "if not exists(select 1 from vendas where indexador = " + Srelib.QStr(xnome.ToUpper()) + ") " +
                     " ALTER TABLE TAXAS_MENSAIS " +
                     " DROP COLUMN [" + xnome.ToUpper() + "]";
        }
        SreDblib.ExecScript(script);

        return(" ");
    }
Exemplo n.º 13
0
    public static String Altera(string xID,
                                string xnome,
                                string xdescricao,
                                string xorgao,
                                string xdivulgacao,
                                string xperiodicidade,
                                string xtipo,
                                string xinicio,
                                string xfim,
                                string xdmais,
                                Boolean xativo,
                                string xobserva_1,
                                string xobserva_2)
    {
        string script = "UPDATE INDEXADORES SET " +
                        " descricao = " + Srelib.QStr(xdescricao) +
                        " ,orgao = " + Srelib.QStr(xorgao) +
                        " ,divulgacao = " + Srelib.QStr(xdivulgacao) +
                        " ,inicio = " + xinicio +
                        " ,fim = " + xfim +
                        " ,dmais = " + xdmais +
                        ", ativo = " + Convert.ToString(Convert.ToInt16(xativo)) +
                        " ,observa_1 = " + Srelib.QStr(xobserva_1) +
                        " ,observa_2 = " + Srelib.QStr(xobserva_2) +
                        " where ID =" + xID;

        SreDblib.ExecScript(script);

        return(" ");
    }
    protected void rbmeiolote2_SelectedIndexChanged(object sender, EventArgs e)
    {
        //
        //Cliente 2
        string grupounidades2 = cbgrupounidades2.Text;
        string parte          = grupounidades2.Substring(grupounidades2.IndexOf("-") + 1).Trim();
        string meiolote       = "1";

        if (parte != "0")
        {
            if (rbmeiolote.SelectedIndex == 0)
            {
                meiolote = "1";
            }
            else
            {
                meiolote = "2";
            }
        }
        else
        {
            rbmeiolote2.Enabled = false;
            rbmeiolote2.Visible = false;
        }
        //
        if (rbtipodestino.SelectedIndex == 1)
        {
            string IDCliente2 = uUnidade.PegaIDCliente(cbproduto2.Value.ToString(), cbgrupo2.Value.ToString(), cbgrupounidades2.Value.ToString(), parte, "1");
            edcliente2.Text = Srelib.QStr0(IDCliente2.Trim(), 5) + " - " + uContato.PegaNomeID(IDCliente2);
            //Cliente
            Label11.Visible    = true;
            edcliente2.Visible = true;
        }
    }
Exemplo n.º 15
0
    public static DataSet LookUpLogAcoes(string xusuario,
                                         string xData1,
                                         string xData2,
                                         string xModulo,
                                         string xAcao,
                                         string xComplementoAcao)
    {
        //
        string script;

        if (xusuario == "")
        {
            script = "SELECT * FROM log WITH(NOLOCK) WHERE (DataHora >= " + Srelib.QStr(Srelib.DataAmericanasembarra(xData1)) +
                     " and DataHora <= " + Srelib.QStr(Srelib.DataAmericanasembarra(xData2)) + ") ";
        }
        else
        {
            script = "SELECT * FROM log WITH(NOLOCK) WHERE Login = "******" and (DataHora >= " + Srelib.QStr(Srelib.DataAmericanasembarra(xData1)) +
                     " and DataHora <= " + Srelib.QStr(Srelib.DataAmericanasembarra(xData2)) + ") ";
        }

        script = script + " and ((tabela like " + Srelib.QStr("%" + xComplementoAcao.ToUpper() + "%") + ") ";

        script = script + " or (obs like " + Srelib.QStr("%" + xComplementoAcao.ToUpper() + "%") + ") ";

        script = script + " or (acao like " + Srelib.QStr("%" + xComplementoAcao.ToUpper() + "%") + ")) ";

        script = script + " order by DataHora";

        return(SreDblib.GetDsScript(script));
    }
Exemplo n.º 16
0
    public static DataSet PegaDadosCep2014(string xcep, Boolean xcepespecial)
    {
        string script = "";

        if (xcep != String.Empty)
        {
            if (!xcepespecial)
            {
                script = "select l.*, l.ufe_sg UF, " +
                         " (select c.loc_nosub from log_localidade c where c.loc_nu_sequencial = l.loc_nu_sequencial ) Cidade " +
                         " from log_logradouro l where l.cep = " + Srelib.QStr(xcep) +
                         " order by UF, Cidade";
            }
            else
            {
                script = " select l.*, l.ufe_sg UF, " +
                         " (select c.loc_nosub from log_localidade c where c.loc_nu_sequencial = l.loc_nu_sequencial ) Cidade " +
                         " from log_grande_usuario l where l.cep = " + Srelib.QStr(xcep) +
                         " order by UF, Cidade";
            }
            return(SreDblib.GetDsScriptCep(script));
        }
        else
        {
            return(null);
        }
    }
Exemplo n.º 17
0
 protected void btdesmarcar_Click(object sender, EventArgs e)
 {
     // Habilitar
     lookupusuario.Enabled = true;
     btprocessa.Enabled    = true;
     btdesmarcar.Enabled   = true;
     btimprimir.Enabled    = false;
     dtinicio.Enabled      = true;
     dtfim.Enabled         = true;
     cktudoperiodo.Enabled = true;
     cbAcao.Enabled        = true;
     cbModulo.Enabled      = true;
     edComplemento.Enabled = true;
     cbModulo.Text         = "";
     cbAcao.Text           = "";
     edComplemento.Text    = "";
     lookupusuario.Selection.UnselectAll();
     lookuplog.Selection.UnselectAll();
     // lookuplog
     dslog = uLog.LookUpLog("", Srelib.DataAmericanasembarra(dtinicio.Text), Srelib.DataAmericanasembarra(dtfim.Text), "", "", "");
     lookuplog.DataSource   = dslog;
     lookuplog.KeyFieldName = "DataHora";
     lookuplog.DataBind();
     Label3.Text = "Log do Usuário (Todos)";
 }
Exemplo n.º 18
0
    public String PegaValorSerasa(String pXml)
    {
        // Conexao Conn = new Conexao(pXml);
        String Qry = "EXEC GN_CALC_SERASA " +
                     Srelib.QStr(Srelib.DataQuery(data, DM.FormatoData)) + "," +
                     numero;


        DataSet    _StProc = new DataSet();
        SqlCommand Command = new SqlCommand(Qry, DM.ConexaoSessao);

        Command.CommandTimeout = 99999;
        SqlDataAdapter DA = new SqlDataAdapter();

        DA.TableMappings.Add("Table", "calcbor");
        DA.SelectCommand = Command;
        DA.Fill(_StProc);
        DataTable DT;

        DT = _StProc.Tables["calcbor"];
        DataRow DR = DT.Rows[0];

        cms = Convert.ToString(DR["valor_serasa"]);

        return(cms);
    }
Exemplo n.º 19
0
    public static String GravaTaxa(string xmes, string xano, string xnome, string xvalor)
    {
        if (xvalor.Trim() == "")
        {
            xvalor = "0";
        }

        if (xmes != string.Empty)
        {
            string script = "UPDATE TAXAS_MENSAIS " +
                            " SET " + xnome + " = " + Srelib.forcaponto(xvalor) +
                            " WHERE MES = " +
                            Srelib.QStr(xmes) +
                            " AND ANO = " +
                            Srelib.QStr(xano);

            //Srelib.QStr(Srelib.QStr0(xmes, 2)) +
            // " AND ANO = " +
            //Srelib.QStr(Srelib.QStr0(xano, 4));
            //" where nome=" + Rgblib.QStr(pParametro);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Exemplo n.º 20
0
    public static String Altera(string xlogin,
                                string xsenha,
                                string xnome,
                                string xsetor,
                                string xfuncao,
                                string xfone,
                                Int32 xperfil,
                                string xemail,
                                string xalcada,
                                Boolean xativo
                                )
    {
        if (xlogin != String.Empty)
        {
            string script = "UPDATE USUARIO SET " +
                            " Senha = " + Srelib.QStr(xsenha) +
                            " ,Nome =  " + Srelib.QStr(xnome) +
                            " ,Setor = " + Srelib.QStr(xsetor) +
                            " ,Funcao =  " + Srelib.QStr(xfuncao) +
                            " ,Fone = " + Srelib.QStr(xfone) +
                            " ,email =  " + Srelib.QStr(xemail) +
                            " ,alcada = " + Srelib.QStr(xalcada) +
                            " ,ativo =  " + Convert.ToString(Convert.ToInt16(xativo)) +
                            " where Login = "******" ");
    }
    protected void rbmeiolote_SelectedIndexChanged(object sender, EventArgs e)
    {
        //
        //Cliente
        string grupounidades = cbgrupounidades.Text;
        string parte         = grupounidades.Substring(grupounidades.IndexOf("-") + 1).Trim();
        string meiolote      = "1";

        if (parte != "0")
        {
            if (rbmeiolote.SelectedIndex == 0)
            {
                meiolote = "1";
            }
            else
            {
                meiolote = "2";
            }
        }
        else
        {
            rbmeiolote.Enabled = false;
            rbmeiolote.Visible = false;
        }
        //
        string IDCliente = uUnidade.PegaIDCliente(cbproduto.Value.ToString(), cbgrupo.Value.ToString(), cbgrupounidades.Value.ToString(), parte, meiolote);

        edcliente.Text    = Srelib.QStr0(IDCliente.Trim(), 5) + " - " + uContato.PegaNomeID(IDCliente);
        Label8.Visible    = true;
        edcliente.Visible = true;
    }
Exemplo n.º 22
0
    public static int PegaMaiorCritica(String wempresa, String wcedente, int wtipo_op, int wbordero, String wduplicata, String wbanco, String wagencia, String wconta, String wcheque)
    {
        String sql = "SELECT top 1 codigo FROM criticas WITH(NOLOCK) " +
                     "WHERE empresa=" + Srelib.QStr(wempresa) +
                     " and cedente=" + Srelib.QStr(wcedente) +
                     " and tipo_operacao=" + Convert.ToString(wtipo_op) +
                     " and bordero=" + Convert.ToString(wbordero) +
                     " and duplicata=" + Srelib.QStr(wduplicata) +
                     " and banco=" + Srelib.QStr(wbanco) +
                     " and agencia=" + Srelib.QStr(wagencia) +
                     " and conta=" + Srelib.QStr(wconta) +
                     " and cheque=" + Srelib.QStr(wcheque);

        if ((SreDblib.GetParametro("CCC") == "SIM"))
        {
            sql = sql + " and codigo>200 and codigo<255";
        }
        else
        {
            sql = sql + " and ((codigo<=200) or (codigo>=255))";
        }
        sql = sql + " ORDER BY codigo DESC";
        DataSet ds = SreDblib.GetDsScript(sql);

        if (ds.Tables[0].Rows.Count == 0)
        {
            return(0);
        }
        else
        {
            return(Convert.ToInt16(ds.Tables[0].Rows[0]["codigo"].ToString()));
        }
    }
Exemplo n.º 23
0
    public static String AlteraContaSaldoInicial(string xID,
                                                 string xcod_conta,
                                                 string xdata,
                                                 string xdescricao,
                                                 string xcomplemento,
                                                 string xsaldo_i,
                                                 string xsaldo_aplicacaoD,
                                                 string xsaldo_aplicacaoB,
                                                 string xdtregistro)
    {
        string script = "UPDATE CONTAS_SALDO_INICIAL SET " +
                        " cod_conta = " + Srelib.QStr(xcod_conta) +
                        " ,data = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdata)) +
                        " ,descricao = " + Srelib.QStr(xdescricao) +
                        " ,complemento = " + Srelib.QStr(xcomplemento) +
                        " ,saldo_i = " + Srelib.forcaponto(xsaldo_i) +
                        " ,saldo_aplicacaoD = " + Srelib.forcaponto(xsaldo_aplicacaoD) +
                        " ,saldo_aplicacaoB = " + Srelib.forcaponto(xsaldo_aplicacaoB) +
                        " ,dtregistro = " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtregistro)) +
                        " where ID =" + xID;

        //revisar quando mexer na cobrança bancária

        SreDblib.ExecScript(script);

        return(" ");
    }
Exemplo n.º 24
0
    public void WebGravaLog(String pBase,
                            String pLogin,
                            String pIp,
                            String pCod,
                            String pComplem,
                            String pXml)
    {
        // Conexao Conn = new Conexao(pXml);
        String Qry = "EXEC WEBLOGINC " +
                     Srelib.QStr(pBase) + "," +
                     Srelib.QStr(pLogin) + "," +
                     Srelib.QStr(pIp) + "," +
                     pCod + "," +
                     Srelib.QStr(pComplem) + "," +
                     Srelib.QStr(pLogin);

        DS = new DataSet();
        SqlCommand Command = new SqlCommand(Qry, DM.ConexaoSessao);

        Command.CommandTimeout = 99999;
        SqlDataAdapter DA = new SqlDataAdapter();

        Command.ExecuteNonQuery();
        // Conn.SqlConn.Close();
    }
Exemplo n.º 25
0
    public static String GravaSaldoInicial(string xcod_conta,
                                           string xdata,
                                           string xdescricao,
                                           string xcomplemento,
                                           string xsaldo_i,
                                           string xsaldo_aplicacaoD,
                                           string xsaldo_aplicacaoB,
                                           string xdtregistro)
    {
        if (xsaldo_i.Trim() == "")
        {
            xsaldo_i = "0.00";
        }

        if (xcod_conta != String.Empty)
        {
            string script = "INSERT INTO CONTAS_SALDO_INICIAL VALUES ( " +
                            Srelib.QStr(xcod_conta) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdata)) +
                            ", " + Srelib.QStr(xdescricao) +
                            ", " + Srelib.QStr(xcomplemento) +
                            ", " + Srelib.forcaponto(xsaldo_i) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdtregistro)) +
                            ", " + Srelib.forcaponto(xsaldo_aplicacaoD) +
                            ", " + Srelib.forcaponto(xsaldo_aplicacaoB) +
                            " ) ";

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Exemplo n.º 26
0
    public void PegaDataAtual(String pXml, Boolean lAprov)
    {
        // Conexao Conn = new Conexao(pXml);
        String Qry = "EXEC GN_dataatual_ret ";

        DS = new DataSet();
        SqlCommand     Command = new SqlCommand(Qry, DM.ConexaoSessao);
        SqlDataAdapter DA      = new SqlDataAdapter();

        DA.TableMappings.Add("Table", "dataatual");
        DA.SelectCommand = Command;
        DA.Fill(DS);
        DataTable DT;

        DT = DS.Tables["dataatual"];
        DataRow  DR  = DT.Rows[0];
        DateTime dt1 = Convert.ToDateTime(DR["dataatual"]);

        DataAtual = String.Format("{0:dd/MM/yyyy}", dt1);
        if (lAprov)
        {
            if (dt1 < Convert.ToDateTime(Srelib.DataHojeMais(0)))
            {
                DataAtual = String.Format("{0:dd/MM/yyyy}", Srelib.DataHojeMais(0));
            }
        }

        // Conn.SqlConn.Close();
        DS.Dispose();
    }
Exemplo n.º 27
0
 protected void cbgrupounidades_SelectedIndexChanged(object sender, EventArgs e)
 {
     //
     if (cbproduto.Text != string.Empty)
     {
         if (cbgrupo.Text != string.Empty)
         {
             if (cbgrupounidades.Text != string.Empty)
             {
                 //Cliente
                 string grupounidades = cbgrupounidades.Text;
                 string parte         = grupounidades.Substring(grupounidades.IndexOf("-") + 1).Trim();
                 string IDCliente     = uUnidade.PegaIDCliente(cbproduto.Value.ToString(), cbgrupo.Value.ToString(), cbgrupounidades.Value.ToString(), parte, "1");
                 edcliente.Text    = Srelib.QStr0(IDCliente.Trim(), 5) + " - " + uContato.PegaNomeID(IDCliente);
                 Label8.Visible    = true;
                 edcliente.Visible = true;
                 //
             }
             else
             {
                 Label8.Visible    = false;
                 edcliente.Visible = false;
                 //
             }
         }
     }
 }
Exemplo n.º 28
0
    public static String Grava(string xlogin,
                               string xdata,
                               string xhora,
                               string xtabela,
                               string xoperacao,
                               string xobs,
                               string xacao)
    {
        if (xlogin != String.Empty)
        {
            if (Convert.ToInt32(xhora.Substring(0, 2)) > 23)
            {
                xhora = "00:00:00";
            }

            string script = "INSERT INTO LOG VALUES ( " +
                            Srelib.QStr(xlogin) +
                            ", " + Srelib.QStr(Srelib.DataAmericanasembarra(xdata) + " " + xhora) +
                            ", newid() " +
                            ", " + Srelib.QStr(xtabela) +
                            ", " + Srelib.QStr(xoperacao) +
                            ", " + Srelib.QStr(xobs) +
                            ", " + Srelib.QStr(xacao) +
                            " ) ";

            //" where nome=" + Rgblib.QStr(pParametro);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Exemplo n.º 29
0
    public static String Grava(string xcodigo,
                               string xproduto,
                               string xlinha1,
                               string xlinha2,
                               string xlinha3,
                               string xlinha4,
                               string xlinha5
                               )
    {
        if (xproduto == "")
        {
            xproduto = "0";
        }

        if ((xcodigo != String.Empty) && (xproduto != String.Empty))
        {
            string script = "INSERT INTO boleto_mensagens VALUES ( " +
                            xcodigo +
                            ", " + xproduto +
                            ", " + Srelib.QStr(xlinha1) +
                            ", " + Srelib.QStr(xlinha2) +
                            ", " + Srelib.QStr(xlinha3) +
                            ", " + Srelib.QStr(xlinha4) +
                            ", " + Srelib.QStr(xlinha5) +
                            " ) ";

            //" where nome=" + Rgblib.QStr(pParametro);

            SreDblib.ExecScript(script);
        }
        return(" ");
    }
Exemplo n.º 30
0
    public static ASPxComboBox MontaCombo(ASPxComboBox pCombo,
                                          string pTabela,
                                          string pCampoExibe,
                                          string pCampoValor,
                                          Boolean pExibeValor,
                                          string pWhere)
    {
        //Documentação - Chamada da Função
        //
        //RgbDbLib.MontaCombo(ASPxComboBox1, "tcobran", "descricao", "tipo", true);
        //
        //Fim Documentação - Chamada da Função

        String       script = "SELECT " + pCampoExibe + "," + pCampoValor + " FROM " + pTabela + " WITH(NOLOCK)" + pWhere;
        DataSet      ds     = SreDblib.GetDsScript(script);
        ListEditItem le;

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            le = new ListEditItem();
            if (pExibeValor)
            {
                le.Text = Srelib.QStr0(dr[pCampoValor].ToString().Trim(), 5) + " - " + dr[pCampoExibe].ToString();
            }
            else
            {
                le.Text = dr[pCampoExibe].ToString();
            };
            le.Value = dr[pCampoValor].ToString();
            pCombo.Items.Add(le);
        }
        return(pCombo);
    }