Beispiel #1
0
        public DataTable pesquisaIdCartao(string cartao)
        {
            DataTable dt = new DataTable();
            //FBBanco fb = new FBBanco();
            SQLBanco fb = new SQLBanco();

            if (fb.conecta())
            {
                fb.executeQuery(@"select * from meiopagamento where mei_nome=@nomecartao",
                                out dt, "@nomecartao", cartao);
                fb.desconecta();
            }

            if (dt.Rows.Count > 0)
            {
                mei_id      = int.Parse(dt.Rows[0]["mei_id"].ToString());
                mei_nome    = dt.Rows[0]["mei_nome"].ToString();
                mei_avista  = decimal.Parse(dt.Rows[0]["mei_avista"].ToString());
                mei_tpg     = dt.Rows[0]["mei_tpg"].ToString();
                mei_cac     = dt.Rows[0]["mei_cac"].ToString();
                mei_cac_des = dt.Rows[0]["mei_cac_des"].ToString();
            }

            return(dt);
        }
Beispiel #2
0
        public void removertodos(int iditemvenda)
        {
            //FBBanco fb = new FBBanco();
            SQLBanco fb = new SQLBanco();

            if (fb.conecta())
            {
                fb.executeNonQuery(@"delete from Cupom 
                    ",
                                   "@id", iditemvenda
                                   );
                fb.desconecta();
            }
        }
Beispiel #3
0
        public void removerTodos()
        {
            //FBBanco fb = new FBBanco();
            SQLBanco fb = new SQLBanco();

            if (fb.conecta())
            {
                fb.executeNonQuery(@"delete from CUPOM
                    ",
                                   "@id", "0"
                                   );
                fb.desconecta();
            }
        }
Beispiel #4
0
        public DataTable pesquisar(int idvenda)
        {
            DataTable dt = new DataTable();
            //FBBanco fb = new FBBanco();
            SQLBanco fb = new SQLBanco();

            if (fb.conecta())
            {
                fb.executeQuery("select * from CUPOM ",
                                out dt, "@ven_id", idvenda);
                fb.desconecta();
            }

            return(dt);
        }
Beispiel #5
0
        public DataTable carregar()
        {
            DataTable dt = new DataTable();
            //FBBanco fb = new FBBanco();
            SQLBanco fb = new SQLBanco();

            if (fb.conecta())
            {
                fb.executeQuery(@"
                                  select * from meiopagamento order by mei_id;
                                "
                                , out dt);
                fb.desconecta();
            }

            return(dt);
        }
Beispiel #6
0
        public DataTable pesquisarResuno(DateTime data)
        {
            string DT1 = Convert.ToString(data).ToString().Substring(0, 10);

            DT1 = DT1.Replace("/", ".");

            DataTable dt = new DataTable();
            //FBBanco fb = new FBBanco();
            SQLBanco fb = new SQLBanco();

            if (fb.conecta())
            {
                fb.executeQuery(@"select * from ResumoFiscal v 
                                  where (dmv = @data) ",
                                out dt, "@data", DT1);
                fb.desconecta();
            }

            if (dt.Rows.Count > 0)
            {
                id  = int.Parse(dt.Rows[0]["id"].ToString());
                nrz = int.Parse(dt.Rows[0]["nrz"].ToString());
                ico = int.Parse(dt.Rows[0]["ico"].ToString());
                fco = int.Parse(dt.Rows[0]["fco"].ToString());
                vgt = decimal.Parse(dt.Rows[0]["vgt"].ToString());
                vmv = decimal.Parse(dt.Rows[0]["vmv"].ToString());
                vds = decimal.Parse(dt.Rows[0]["vds"].ToString());
                vcn = decimal.Parse(dt.Rows[0]["vcn"].ToString());
                dmv = DateTime.Parse(dt.Rows[0]["dmv"].ToString());
                seq = dt.Rows[0]["seq"].ToString();
                cro = dt.Rows[0]["cro"].ToString();
                mfd = dt.Rows[0]["mfd"].ToString();
                tip = dt.Rows[0]["tip"].ToString();
                mar = dt.Rows[0]["mar"].ToString();
                mod = dt.Rows[0]["mod"].ToString();
                vsb = dt.Rows[0]["vsb"].ToString();
                dsb = dt.Rows[0]["dsb"].ToString();
                hsb = dt.Rows[0]["hsb"].ToString();
                nse = dt.Rows[0]["nse"].ToString();
                nou = int.Parse(dt.Rows[0]["nou"].ToString());
                nef = int.Parse(dt.Rows[0]["nef"].ToString());
            }

            return(dt);
        }
Beispiel #7
0
        public int inserir(string cup_numero, string cup_codigo, string cup_produto, string cup_aliquota, string cup_quantidade, decimal cup_total)
        {
            //FBBanco fb = new FBBanco();
            SQLBanco fb      = new SQLBanco();
            int      idvenda = 0;;

            if (fb.conecta())
            {
                idvenda = fb.executeScalar(@"insert into Cupom(cup_numero,cup_codigo,cup_produto,cup_aliquota,cup_quantidade, cup_total, cup_data
                    ) output INSERTED.cup_id
values (
                    @cup_numero,@cup_codigo,@cup_produto,@cup_aliquota,@cup_quantidade, @cup_total, @cup_data
                    ) ", "@cup_numero", cup_numero, "@cup_codigo", cup_codigo, "@cup_produto", cup_produto, "@cup_aliquota", cup_aliquota, "@cup_quantidade", cup_quantidade, "@cup_total", cup_total, "@cup_data", DateTime.Now
                                           );

                fb.desconecta();
                cup_id = idvenda;
                return(idvenda);
            }
            cup_id = idvenda;
            return(idvenda);
        }
Beispiel #8
0
        public int inserir(int id, int nrz, int ico, int fco, int vgt, int vmv, int vds, int vcn, DateTime dmv, string seq,
                           string cro, string mfd, string tip, string mar, string mod, string vsb, string dsb, string hsb, string nse, int nou, int nef)
        {
            //FBBanco fb = new FBBanco();
            SQLBanco fb      = new SQLBanco();
            int      idvenda = 0;;

            if (fb.conecta())
            {
                idvenda = fb.executeScalar(@"insert into Venda(id,nrz,ico,fco,vgt,vmv,vds,vcn,dmv,seq,cro,mfd,tip,mar,mod,vsb,dsb,hsb,nse,nou,nef
                    ) output INSERTED.id 
values ( @id,@nrz,@ico,@fco,@vgt,@vmv,@vds,@vcn,@dmv,@seq,@cro,@mfd,@tip,@mar,@mod,@vsb,@dsb,@hsb,@nse,@nou,@nef
                    ) ", "@id", id, "@nrz", nrz, "@ico", ico, "@fco", fco, "@vgt", vgt, "@vmv", vmv, "@vds", vds, "@vcn", vcn, "@dmv", dmv, "@seq", seq,
                                           "@cro", cro, "@mfd", mfd, "@tip", tip, "@mar", mar, "@mod", mod, "@vsb", vsb, "@dsb", dsb, "@hsb", hsb, "@nse", nse, "@nou", nou, "@nef", nef
                                           );

                fb.desconecta();
                id = idvenda;
                return(idvenda);
            }
            id = idvenda;
            return(idvenda);
        }
Beispiel #9
0
        public int pesquisaTotalCupom()
        {
            int       Total = 0;
            DataTable dt    = new DataTable();
            //FBBanco fb = new FBBanco();
            SQLBanco fb = new SQLBanco();

            if (fb.conecta())
            {
                fb.executeQuery(@"select max(cup_id) as Numero from cupom  ", out dt, "@id", "0");
                fb.desconecta();
            }
            if (dt.Rows.Count > 0)
            {
                string num = dt.Rows[0]["Numero"].ToString();
                if (num == "")
                {
                    num = "0";
                }
                Total = int.Parse(num);
            }
            return(Total);
        }