private Retiro CopyCheque(Cheque cheque) { Retiro ret = new Retiro(); ret.cuenta_destino = Convert.ToInt64(cheque.cuenta_destino); ret.fecha = cheque.retiro_fecha; ret.importe = cheque.importe; ret.moneda = Convert.ToInt32(cheque.tipo_moneda); return ret; }
private void btnGrabar_Click(object sender, EventArgs e) { if (cmbNroCuenta.SelectedItem == null) { MessageBox.Show("Seleccione un Número de Cuenta, por favor"); return; } if (cmbNroCuenta.Text == " ") { MessageBox.Show("Seleccione un Número de Cuenta, por favor"); return; } if (cmbMoneda.SelectedItem == null) { MessageBox.Show("Seleccione un tipo de moneda, por favor"); return; } else { if (cmbMoneda.Text != "Dólares") { MessageBox.Show("El importe debe estar expresado en Dolares"); return; } } if (txtImporte.Text == "") { MessageBox.Show("Ingrese un Importe, por favor"); return; } decimal temp; try { if (txtImporte.Text != "") { temp = Convert.ToDecimal(txtImporte.Text); if (temp < 0) { MessageBox.Show("El importe debe ser positivo."); return; } } } catch (Exception h) { MessageBox.Show("Importe solo puede contener números",h.ToString()); return; } Conexion con = new Conexion(); //CORROBORO SALDO string query = "SELECT saldo FROM LPP.CUENTAS WHERE num_cuenta = "+ Convert.ToDecimal(cmbNroCuenta.Text)+" AND saldo >= "+Convert.ToDecimal(txtImporte.Text)+""; importe = Convert.ToDecimal(txtImporte.Text); id_moneda = this.getIdMoneda(); con.cnn.Open(); SqlCommand command = new SqlCommand(query, con.cnn); SqlDataReader lector = command.ExecuteReader(); if (lector.Read()) { Cheque form_cheque = new Cheque(Convert.ToDecimal(cmbNroCuenta.Text), usuario); form_cheque.importe = importe; form_cheque.id_moneda = id_moneda; form_cheque.Show(); this.Close(); } else { MessageBox.Show("La cuenta tiene saldo insuficiente"); return; } con.cnn.Close(); }
public IngresarDNI(Cliente cli, Cheque cheq) { cliente = cli; cheque = cheq; InitializeComponent(); }
private object CrearPotencialCheque() { Cuenta cuentaSeleccionada = ((Cuenta)cmbCuenta.SelectedItem); Cheque cheque = new Cheque(); cheque.cuenta_destino = cuentaSeleccionada.id; cheque.importe = Convert.ToDouble(txtRetirar.Text); cheque.retiro_fecha = Utils.fechaSistema; cheque.id_egreso = daoCheque.generarEgreso(); cheque.tipo_moneda = cuentaSeleccionada.tipoMoneda; cheque.cod_banco = DAOBanco.generarBanco(); return cheque; }
private void btnGrabar_Click(object sender, EventArgs e) { if (cmbNroCuenta.SelectedItem == null) { MessageBox.Show("Seleccione un Número de Cuenta, por favor"); return; } if (cmbMoneda.SelectedItem == null) { MessageBox.Show("Seleccione un tipo de moneda, por favor"); return; } else { if (cmbMoneda.Text != "Dólares") { MessageBox.Show("El importe debe estar expresado en Dolares"); return; } } if (txtImporte.Text == "") { MessageBox.Show("Ingrese un Importe, por favor"); return; } int temp; try { if (txtImporte.Text != "") { temp = Convert.ToInt32(txtImporte.Text); } } catch (Exception h) { MessageBox.Show("Importe solo puede contener números", h.ToString()); return; } Conexion con = new Conexion(); //CORROBORO SALDO string query = "SELECT saldo FROM LPP.CUENTAS WHERE num_cuenta = " + Convert.ToDecimal(cmbNroCuenta.Text) + " AND saldo >= " + Convert.ToDecimal(txtImporte.Text) + ""; importe = Convert.ToDecimal(txtImporte.Text); id_moneda = this.getIdMoneda(); con.cnn.Open(); SqlCommand command = new SqlCommand(query, con.cnn); SqlDataReader lector = command.ExecuteReader(); if (lector.Read()) { Cheque form_cheque = new Cheque(Convert.ToDecimal(cmbNroCuenta.Text), usuario); form_cheque.importe = importe; form_cheque.id_moneda = id_moneda; form_cheque.Show(); this.Close(); } else { MessageBox.Show("La cuenta tiene saldo insuficiente"); return; } con.cnn.Close(); }