コード例 #1
0
        private void OnBtnAdLivros(object sender, Event e)
        {
            double nPreco;
            string sLivros, sISBN, sEdtLivro, sPrecoTotal;

            sISBN     = edtISBN.Value;
            sEdtLivro = edtLivro.Value;
            if (sISBN.Length > 0)
            {
                sLivros = sISBN + " - " + sEdtLivro + " - R$ " +
                          RotinasGlobais.Rotinas.sPreco;
                if (RotinasGlobais.Rotinas.PesquisaItemLista(lstLivros, sLivros) == -1)
                {
                    slISBNs.Add(sISBN);
                    slPrecos.Add(RotinasGlobais.Rotinas.sPreco);
                    slQtdEstoque.Add(RotinasGlobais.Rotinas.sQtdEstoque);
                    lstLivros.Append(sLivros);
                    nPreco      = Double.Parse(RotinasGlobais.Rotinas.sPreco);
                    nPrecoTotal = nPrecoTotal + nPreco;
                }
                edtISBN.Clear();
                edtLivro.Clear();
                sPrecoTotal         = "R$ " + Convert.ToString(nPrecoTotal);
                edtPrecoTotal.Value =
                    RotinasGlobais.Rotinas.VirgulaParaPonto(sPrecoTotal, true);
            }
            e.Skip();
        }
コード例 #2
0
        //---------------------------------------------------------------------------
        public void AdicionaItemLista(wx.ListBox lstLista,
                                      ArrayList slCodLista, wx.TextCtrl sCampoCodigo, wx.TextCtrl sCampoDesc)
        {
            string sItems;

            if (sCampoDesc.Value.Equals("") == false)
            {
                sItems = sCampoCodigo.Value + " - " + sCampoDesc.Value;
                if (PesquisaItemLista(lstLista, sItems) == -1)
                {
                    slCodLista.Add(sCampoCodigo.Value);
                    lstLista.Append(sItems);
                }
                sCampoCodigo.Clear();
                sCampoDesc.Clear();
            }
        }
コード例 #3
0
        //---------------------------------------------------------------------------
        public void AdicionaValoresLista(string sTextoSql,
                                         wx.ListBox lstLista, ArrayList slCodLista)
        {
            lstLista.Clear();
            slCodLista.Clear();

            OleDbCommand Consulta = gConexao.CreateCommand();

            Consulta.CommandText = sTextoSql;

            OleDbDataReader Leitor = Consulta.ExecuteReader();

            while (Leitor.Read())
            {
                slCodLista.Add(Leitor.GetValue(0).ToString());
                lstLista.Append(Leitor.GetValue(0).ToString() + " - " +
                                Leitor.GetValue(1).ToString());
            }
            Leitor.Close();
        }