Esempio n. 1
0
        public List <Venda> ListarVenda()
        {
            List <Venda> Lista = new List <Venda>();

            this.Conect();
            sql = "SELECT id, data, vlrtotal, desconto, qtditens, idcliente, idoperador FROM tbvenda  order by id;";
            cmd = new NpgsqlCommand(sql, con);
            rdr = cmd.ExecuteReader();

            while (rdr.Read())
            {
                Venda            v          = new Venda();
                CItemVenda       i          = new CItemVenda();
                List <ItemVenda> itensVenda = new List <ItemVenda>();
                v.setID(rdr.GetInt32(0));
                v.setData(rdr.GetString(1));
                v.setVlrTotal(rdr.GetDouble(2));
                v.setDesconto(rdr.GetDouble(3));
                v.setQtdItens(rdr.GetInt32(4));
                v.setIdCliente(rdr.GetInt32(5));
                v.setIdOperador(rdr.GetInt32(6));
                itensVenda = i.ListarItemVenda(v.getId());
                v.setItensVenda(itensVenda);
                Lista.Add(v);
            }
            this.Desconect();
            return(Lista);
        }
Esempio n. 2
0
        private void btnItensDoc_Click(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection documentoSelect =
                this.lstListaVenda.SelectedItems;

            foreach (ListViewItem item in documentoSelect)
            {
                iv.TelaItemVenda(iv.ListarItemVenda(int.Parse(item.SubItems[0].Text)));
            }
        }