private void Venta_Load(object sender, EventArgs e) { this.Icon = Properties.Resources.Icons8_Windows_8_Ecommerce_Cash_Register; int tamanoL = this.Width / 4; int tamanoR = this.Height / 5; panel1.Left = tamanoL; panel1.Top = tamanoR; double subtotal = 0, isv = 0, total = 0; this.Icon = Properties.Resources.Icons8_Windows_8_Ecommerce_Cash_Register; txtVendedor.Text = Objetos_Globales.usuario.nombre_Usuario; txtFechaVenta.Text = Objetos_Globales.fechaHoyCorta(); for (int i = 0; i < Objetos_Globales.articulos.Count; i++) { total += ((Articulo)Objetos_Globales.articulos[i]).MontoPago; } isv = total * 0.15; subtotal = total - isv; txtSubtotal.Text = subtotal.ToString(); txtISV.Text = isv.ToString(); txtTotalPagar.Text = total.ToString(); }
private void btnAceptar_Click(object sender, EventArgs e) { if (BD.Busqueda_Interes(int.Parse(txtCodigoPago.Text)) == 0) { if (double.Parse(txtIngresado.Text) < double.Parse(txtMonto.Text)) { MessageBoxTemporal.Show("El monto ingresado no es suficiente para pagar", "Mensaje importante", 1, false); } else { if (BD.Modificar_Meses(Objetos_Mantenimiento.articuloMantenimiento.NumeroRecibo, Objetos_Mantenimiento.articuloMantenimiento.NumeroSerie, Objetos_Mantenimiento.articuloMantenimiento.Meses - int.Parse(numMeses.Value.ToString())) > 0) { BD.Ingreso_Pago_Interes(Objetos_Mantenimiento.articuloMantenimiento.NumeroRecibo, Objetos_Mantenimiento.articuloMantenimiento.NumeroSerie, int.Parse(txtCodigoPago.Text), txtCliente.Text, Objetos_Globales.fechaHoyCorta(), double.Parse(txtMonto.Text), Objetos_Globales.usuario.codigo_Usuario); MessageBoxTemporal.Show("Transaccion Finalizada", "Mensaje importante", 1, false); this.Hide(); Menu men = new Sistema_Empenos_Anderson.Menu(); men.Show(); } else { MessageBoxTemporal.Show("Ha ocurrido un error", "Mensaje importante", 1, false); } } } else { MessageBoxTemporal.Show("Este codigo de pago ya fue utilizado", "Mensaje Importante", 2, false); } }
private void btnRetirar_Click(object sender, EventArgs e) { if (txtRetiro.Text == "" || txtMontoPagado.Text == "") { MessageBoxTemporal.Show("Error no deje los campos vacios", "Error", 2, false); } else if (BD.Busqueda_Retiro(int.Parse(txtRetiro.Text)) == 0) { if (Double.Parse(txtMontoPagado.Text) < Objetos_Mantenimiento.articuloMantenimiento.PrecioPago(Objetos_Mantenimiento.articuloMantenimiento.Meses) || txtMontoPagado.Text == null) { MessageBoxTemporal.Show("El valor ingresado no puede ser menor al monto a pagar", "Alerta", 2, false); } else { double cambio = 0; BD.Actualizar_Estado_Articulo(txtSerie.Text, int.Parse(txtRecibo.Text), 4, "Articulo"); cambio = double.Parse(txtMontoPagado.Text) - Objetos_Mantenimiento.articuloMantenimiento.PrecioPago(Objetos_Mantenimiento.articuloMantenimiento.Meses); MessageBoxTemporal.Show("El articulo fue retirado con exito\nCambio:" + cambio, "Informacion", 2, false); try { BD.Ingreso_Retiro(int.Parse(txtRetiro.Text), Objetos_Globales.identidadTemporal, int.Parse(txtRecibo.Text), txtSerie.Text, Objetos_Globales.fechaHoyCorta()); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } this.Close(); } } else { MessageBoxTemporal.Show("Este codigo de retiro ya fue utilizado", "Mensaje Importante", 2, false); } }