private void btnLimpar_Click(object sender, EventArgs e)
 {
     listaDeSaida.Items.Clear();
     listaProduto.Clear();
     TxtBoxPesquisaProd.Select();
     total = 0;
 }
Example #2
0
        private void btnSangria_Click(object sender, EventArgs e)
        {
            TelaDeSangria sangria = new TelaDeSangria();

            sangria.ShowDialog();
            TxtBoxPesquisaProd.Select();
        }
Example #3
0
 private void Bt_Remover_Prod_Click(object sender, EventArgs e)
 {
     if (listaCaixa.SelectedItems.Count > 0)
     {
         for (int i = listaCaixa.SelectedItems.Count; i >= 1; i--)
         {
             ListViewItem item = new ListViewItem();
             item = listaCaixa.SelectedItems[i - 1];
             for (int j = 0; j < listaProduto.Count; j++)
             {
                 if (listaProduto[j].prodNome == listaCaixa.SelectedItems[i - 1].SubItems[1].Text)
                 {
                     listaProduto[j].prodQuantidade -= 1;
                 }
             }
             listaCaixa.Items.Remove(listaCaixa.SelectedItems[i - 1]);
             total        -= Convert.ToDouble(item.SubItems[3].Text) * Convert.ToDouble(item.SubItems[4].Text);
             LblTotal.Text = "R$: " + total.ToString("F2");
         }
     }
     else
     {
         MessageBox.Show("Não tem nenhum item selecionado!");
     }
     TxtBoxPesquisaProd.Select();
 }
Example #4
0
 private void TxtBoxPesquisaProd_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         pesquisa = TxtBoxPesquisaProd.Text;
         pesquisaListaCaixa();
     }
     TxtBoxPesquisaProd.Select();
 }
Example #5
0
 private void btnFecharCaixa_Click(object sender, EventArgs e)
 {
     travarBotoes();
     listaCaixa.Items.Clear();
     LblTotal.Text = "R$: 0,00";
     total         = 0;
     listaProduto.Clear();
     TxtBoxPesquisaProd.Select();
 }
Example #6
0
 private void cancelarVenda()
 {
     if (MessageBox.Show("Tem certeza?", " ", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         listaCaixa.Items.Clear();
         LblTotal.Text = "R$: 0,00";
         total         = 0;
         listaProduto.Clear();
     }
     TxtBoxPesquisaProd.Select();
 }
 private void txtBoxQnt_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         pesquisa = TxtBoxPesquisaProd.Text;
         valida();
         TxtBoxPesquisaProd.Select();
     }
     else
     {
         txtBoxQnt.Select();
     }
 }
 public TelaDeSaidaProduto()
 {
     InitializeComponent();
     ultimoId();
     lblTotalItens.Text = "0";
     txtBoxQnt.Text     = "1";
     lblData.Text       = DateTime.Now.ToString("dd/MM/yyyy");
     lblHora.Text       = DateTime.Now.ToString("HH:mm");
     lblNumSaida.Text   = idSaida.ToString();
     TxtBoxPesquisaProd.Select();
     btnSalvar.Visible = false;
     txtBoxFunc.Text   = Global.nomeColaborador;
 }
Example #9
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();
 }
Example #11
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();
        }
Example #12
0
        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();
                }
            }
        }
Example #13
0
 private void TxtBoxPesquisaProd_KeyDown_1(object sender, KeyEventArgs e)
 {
     pesquisa = TxtBoxPesquisaProd.Text;
     pesquisaListaCaixa();
     TxtBoxPesquisaProd.Select();
 }
Example #14
0
 private void listaDoCaixa_Load(object sender, EventArgs e)
 {
     TxtBoxPesquisaProd.Select();
 }