예제 #1
0
 private void btnVentaComb_Click(object sender, EventArgs e)
 {
     if (txtCantidadComb.Text == "")
     {
         MessageBox.Show("Falta ingresar el campo cantidad", "Falta Cantidad");
     }
     else if (Convert.ToDouble(lblPagoTotal.Text) >= Convert.ToDouble(txtCantidadComb.Text))
     {
         _usuario         = Login._nombreEmpleado;
         _cantidad        = Convert.ToDouble(txtCantidadComb.Text);
         _efectivoDolares = Convert.ToDouble(txtDolaresEfectivo.Text);
         _efectivoPesos   = Convert.ToDouble(txtPesosEfectivo.Text);
         _tarjetaDolares  = Convert.ToDouble(txtDolaresTarjeta.Text);
         _tarjetaPesos    = Convert.ToDouble(txtPesosTarjeta.Text);
         _comentario      = "GRACIAS POR SU COMPRA!! \n" + txtComentarioComb.Text;
         _totalPago       = Convert.ToDouble(lblPagoTotal.Text);
         if (_cantidad != 0)
         {
             try
             {
                 SqlCommand ventaComb = VentaCombinada();
                 ventaComb.ExecuteNonQuery();
                 MessageBox.Show(@"Venta hecha correctamente.");
                 TicketComb tkc = new TicketComb();
                 tkc.ShowDialog();
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.ToString());
             }
             finally
             {
                 Connection.conn.Close();
                 MostrarVentasComb();
                 ValoresPorDefaultComb();
             }
         }
         else
         {
             MessageBox.Show("La cantidad esta en 0.00", "Advertencia");
             ValoresPorDefaultComb();
         }
     }
     else
     {
         MessageBox.Show("El pago es menor al total", "Advertencia");
     }
 }
예제 #2
0
 private void btnReimpresionComb_Click(object sender, EventArgs e)
 {
     if (dgvVentasComb.CurrentRow != null)
     {
         _usuario         = Login._nombreEmpleado;
         _cantidad        = Convert.ToDouble(dgvVentasComb.CurrentRow.Cells[1].Value);
         _efectivoDolares = Convert.ToDouble(dgvVentasComb.CurrentRow.Cells[2].Value);
         _efectivoPesos   = Convert.ToDouble(dgvVentasComb.CurrentRow.Cells[3].Value);
         _tarjetaDolares  = Convert.ToDouble(dgvVentasComb.CurrentRow.Cells[4].Value);
         _tarjetaPesos    = Convert.ToDouble(dgvVentasComb.CurrentRow.Cells[5].Value);
         _comentario      = "GRACIAS POR SU COMPRA!! \n";
         _totalPago       = Convert.ToDouble(dgvVentasComb.CurrentRow.Cells[9].Value);
         TicketComb tkc = new TicketComb();
         tkc.ShowDialog();
         ValoresPorDefaultComb();
     }
     else
     {
         MessageBox.Show("Ninguna venta seleccionada");
     }
 }