private void frmPDV_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.F1: if (Lista.Items.Count < 1) { btnDeletaItem.Enabled = false; btnFecharConta.Enabled = false; } else { ListViewItem lvi = new ListViewItem(ca.codigo.ToString()); if (Lista.Items.Count < 1) { btnDeletaItem.Enabled = true; btnFecharConta.Enabled = true; } lblSomatorio2.Text = lblSomatorio.Text; // Manter o Valor do somatório para jogar para o frmPagamento (lblSomatorio2 - INVISÍVEL). frmPagamento pg = new frmPagamento(Convert.ToDecimal(lblSomatorio2.Text)); pg.ShowDialog(); Lista.Items.Clear(); lblSomatorio.Text = String.Empty; Limpar_Campos(); txtProduto2.Text = String.Empty; txtValor2.Text = String.Empty; btnDeletaItem.Enabled = false; btnFecharConta.Enabled = false; } break; case Keys.F2: try { Lista.SelectedItems[0].Remove(); Somatorio(); // Chamada do método para somar coluna de Total. txtCodigo.Focus(); if (Lista.Items.Count < 1) { btnDeletaItem.Enabled = false; btnFecharConta.Enabled = false; } else { btnDeletaItem.Enabled = true; btnFecharConta.Enabled = true; } } catch (Exception) { MessageBox.Show("Marque o Item a ser removido...", "P.D.V.", MessageBoxButtons.OK, MessageBoxIcon.Warning); } break; } }
private void btnFecharConta_Click(object sender, EventArgs e) { ListViewItem lvi = new ListViewItem(ca.codigo.ToString()); if (Lista.Items.Count < 1) { btnDeletaItem.Enabled = false; btnFecharConta.Enabled = false; } else { btnDeletaItem.Enabled = true; btnFecharConta.Enabled = true; } lblSomatorio2.Text = lblSomatorio.Text; // Manter o Valor do somatório para jogar para o frmPagamento (lblSomatorio2 - INVISÍVEL). frmPagamento pg = new frmPagamento(Convert.ToDecimal(lblSomatorio2.Text)); pg.ShowDialog(); panelCxLivre.Visible = true; lblCxLivre.Visible = true; btnDeletaItem.Enabled = false; btnFecharConta.Enabled = false; Lista.Items.Clear(); lblSomatorio.Text = String.Empty; Limpar_Campos(); txtProduto2.Text = String.Empty; txtValor2.Text = String.Empty; txtCalc.Text = String.Empty; txtTot.Text = String.Empty; txtCod.Text = String.Empty; txtCod.Visible = false; lblGramas.Visible = false; txtQtd.Enabled = true; txtCodigo.Focus(); }