Exemple #1
0
        private void BtnFinalizarVenda_Click_1(object sender, EventArgs e)
        {
            DadosTableAdapters.Config_SistemaTableAdapter config = new DadosTableAdapters.Config_SistemaTableAdapter();
            var  auxFiscal = config.retornarConfig();
            bool fiscal    = Convert.ToBoolean(auxFiscal[0]["fiscal"]);

            // try
            //{
            if (fiscal)
            {
                if (listaCaixa.Items.Count > 0)
                {
                    if (total > 0)
                    {
                        itensDaLista = new string[this.listaCaixa.Items.Count, 7];
                        for (int i = 0; i < this.listaCaixa.Items.Count; i++)
                        {
                            for (int j = 0; j <= 6; j++)
                            {
                                itensDaLista[i, j] = listaCaixa.Items[i].SubItems[j].Text;
                            }
                        }
                        TelaDePagamento telaDePagamento = new TelaDePagamento(itensDaLista, total);
                        telaDePagamento.ShowDialog();
                        listaProduto.Clear();
                        listaCaixa.Items.Clear();
                    }
                }
                else
                {
                    MessageBox.Show("Não tem itens na venda");
                }
                total         = 0;
                LblTotal.Text = "";
                TxtBoxPesquisaProd.Select();
            }
            else
            {
                MessageBox.Show("Favor preencher todos os dados fiscais da empresa");
            }
            //}

            /*catch(IOExeption er)
             * {
             *  MessageBox.Show("Temos um erro aqui");
             * }
             * }*/
        }
 private void TxtBoxPesquisaProd_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         int a;
         if (int.TryParse(txtBoxQnt.Text.Trim(), out a))
         {
             this.pesquisa = TxtBoxPesquisaProd.Text;
             valida();
         }
         else
         {
             MessageBox.Show("Valor incorreto inserido na quantidade");
         }
     }
     TxtBoxPesquisaProd.Select();
 }
Exemple #3
0
        //FUNÇÃO PARA ALTERNAR ABRIR E FECHAR CAIXA
        public void travarBotoes()
        {
            var idCaixa = caixa.pegarIDUltimoCaixa();
            var aux     = caixa.pegarCaixaPorID(Convert.ToInt32(idCaixa[0]["idCaixa"]));


            if (btnFecharCaixa.Visible)
            {
                //var idCaixa = caixa.pegarIDUltimoCaixa();
                //var aux = caixa.pegarCaixaPorID(Convert.ToInt32(idCaixa[0]["idCaixa"]));

                caixa.fecharCaixa(Convert.ToDouble(aux[0]["valorAtual"]), Convert.ToByte(0), Convert.ToInt32(aux[0]["idCaixa"]));
                MessageBox.Show("Caixa fechado com Sucesso");
                btnFecharCaixa.Visible = false;
                btnAbrirCaixa.Visible  = true;
                lblCaixa.Text          = "Abrir Caixa";
                listaCaixa.Items.Clear();
                txtBoxQnt.Enabled          = false;
                BtnFinalizarVenda.Enabled  = false;
                Bt_Add_Prod.Enabled        = false;
                Bt_Cancelar_Venda.Enabled  = false;
                Bt_Remover_Prod.Enabled    = false;
                TxtBoxPesquisaProd.Enabled = false;
                btnSangria.Enabled         = false;
            }
            else
            {
                /*var saldoAnterior = caixa.pegarCaixaPorID(Convert.ToInt32(idCaixa[0]["idCaixa"]));
                 * caixa.inserirCaixa(Convert.ToDouble(saldoAnterior[0]["fechamentoCaixa"]), 0, Convert.ToDouble(saldoAnterior[0]["fechamentoCaixa"]), DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss.fff"), 1);
                 * MessageBox.Show("Caixa aberto com sucesso");*/
                btnFecharCaixa.Visible = true;
                btnAbrirCaixa.Visible  = false;
                lblCaixa.Text          = "Fechar Caixa";

                /*MessageBox.Show("Caixa aberto com: R$" + saldoAnterior[0]["fechamentoCaixa"]);
                 */
                txtBoxQnt.Enabled          = true;
                BtnFinalizarVenda.Enabled  = true;
                Bt_Add_Prod.Enabled        = true;
                Bt_Cancelar_Venda.Enabled  = true;
                Bt_Remover_Prod.Enabled    = true;
                TxtBoxPesquisaProd.Enabled = true;
                btnSangria.Enabled         = true;
            }
            TxtBoxPesquisaProd.Select();
        }
        private void TxtBoxPesquisaProd_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                int pesquisa;
                if (Int32.TryParse(TxtBoxPesquisaProd.Text.Trim(), out pesquisa))
                {
                    TxtBoxPesquisaProd.Select();
                    listaVendas.Items.Clear();

                    var varVendas = listaDeVendas.retornarVendaPorId(Convert.ToInt32(pesquisa));

                    if (varVendas.Count > 0)
                    {
                        ListViewItem item = new ListViewItem();


                        item.SubItems.Add(varVendas[0]["idVenda"].ToString());
                        item.SubItems.Add(Convert.ToDateTime(varVendas[0]["vendData"]).ToString("dd/MM/yyyy"));
                        item.SubItems.Add(Convert.ToDouble(varVendas[0]["valorCompra"]).ToString("F2"));

                        listaVendas.Items.Add(item);
                    }
                }
                else if (TxtBoxPesquisaProd.Text == "")
                {
                    carregarListaVendas();
                }
                else
                {
                    MessageBox.Show("Este campo não aceita letras, somente número");
                    TxtBoxPesquisaProd.Text = "";
                    TxtBoxPesquisaProd.Select();
                }
            }
        }
Exemple #5
0
 private void TxtBoxPesquisaProd_KeyDown_1(object sender, KeyEventArgs e)
 {
     pesquisa = TxtBoxPesquisaProd.Text;
     pesquisaListaCaixa();
     TxtBoxPesquisaProd.Select();
 }
Exemple #6
0
 private void listaDoCaixa_Load(object sender, EventArgs e)
 {
     TxtBoxPesquisaProd.Select();
 }