private void btnCuentaCorriente_Click(object sender, EventArgs e) { try { decimal TotalPagar = Convert.ToDecimal(lblTotalPagarReal.Text); CuentaCorrienteWF _cuenta = new CuentaCorrienteWF(TotalPagar, idVenta); _cuenta.Show(); } catch (Exception ex) { const string message = "Error en el sistema. Intente nuevamente o comuniquese con el administrador."; const string caption = "Atención"; var result = MessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Warning); throw new Exception(); } }
void Menu_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode.ToString() == "F12") { if (listaProductos.Count > 0) { int idusuarioLogueado = Sesion.UsuarioLogueado.IdUsuario; int idusuario = idusuarioLogueado; listaProductos[0].PrecioVentaFinal = Convert.ToDecimal(lblTotalPagarReal.Text); //bool Exito = Negocio.Ventas.RegistrarVenta(listaProductos, idusuario); idVenta = Negocio.Ventas.RegistrarVenta(listaProductos, idusuario); BloquearPantalla(); ///// GENERAR TICKET......... Ticket ticket = new Ticket(); ticket.AddHeaderLine("La Brújula"); ticket.AddHeaderLine("EXPEDIDO EN:"); ticket.AddHeaderLine("44 N°1111"); ticket.AddHeaderLine("La Plata, BsAS"); ticket.AddHeaderLine("RFC: CSI-020226-MV4"); ticket.AddSubHeaderLine("Ticket # 1"); ticket.AddSubHeaderLine(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString()); foreach (DataGridViewRow row in dgvVentas.Rows) { if (row.Cells[0].Value != null) { ticket.AddItem(row.Cells[2].Value.ToString(), row.Cells[1].Value.ToString(), row.Cells[4].Value.ToString()); } } //ticket.AddTotal("SUBTOTAL", "12.00"); //ticket.AddTotal("IVA", "0"); ticket.AddTotal("TOTAL", lblTotalPagarReal.Text); ticket.AddTotal("", ""); //ticket.AddTotal("RECIBIDO", "0"); //ticket.AddTotal("CAMBIO", "0"); ticket.AddTotal("", ""); var Efectivo = textBox1.Text; var Vuelto = lblCambio.Text; ticket.AddFooterLine(Efectivo); ticket.AddFooterLine(Vuelto); // ticket.PrintTicket("EPSON TM-T88III Receipt"); //Nombre de la impresora de tickets //ticket.PrintTicket("RICOH MP C2004 PCL 6"); //btnCuentaCorriente.Visible = true; //} } } if (e.KeyCode.ToString() == "F10") { btnCobrar.Visible = true; btnCuentaCorriente.Visible = true; lblEfectivoFijo.Visible = true; textBox1.Visible = true; textBox1.Focus(); lblVueltoFijo.Visible = true; lblCambio.Visible = true; btnFinalizarVenta.Visible = false; } if (e.KeyCode.ToString() == "F1") { decimal TotalPagar = Convert.ToDecimal(lblTotalPagarReal.Text); CuentaCorrienteWF _cuenta = new CuentaCorrienteWF(TotalPagar, idVenta); _cuenta.Show(); } }