private void importeCuenta(string tipo, double importe) { movimiento.Fecha = DateTime.Now; movimiento.Nro_cuenta = cuenta.Nro_cuenta; movimiento.Tipo = tipo; if (tipo == "A") { movimiento.Importe = importe; } else if (tipo == "D") { movimiento.Importe = importe * (-1); } movimiento.estado = EstadoEntidad.agregado; bool valid = new Soporte.ValidacionDatos(movimiento).validacion(); if (valid) { mensaje = movimiento.GuardarCambios(); // MessageBox.Show(mensaje); } }
private void btn00Guardar_Click(object sender, EventArgs e) { if (txt00numero.Text != "" && txt00nombre.Text != "") { cuenta.Nro_cuenta = txt00numero.Text; if (cmb00Tipo.SelectedIndex == 0) { cuenta.Tipo = "CTE"; } else if (cmb00Tipo.SelectedIndex == 1) { cuenta.Tipo = "AHO"; } if (cmb00moneda.SelectedIndex == 0) { cuenta.Moneda = "Bs"; } else if (cmb00moneda.SelectedIndex == 1) { cuenta.Moneda = "$us"; } cuenta.Nombre = txt00nombre.Text; cuenta.Saldo = 0; bool valid = new Soporte.ValidacionDatos(cuenta).validacion(); if (valid) { mensaje = cuenta.GuardarCambios(); MessageBox.Show(mensaje); } importeCuenta("A", 0); paneles(); mostrarOpciones(); } }
private void transaccion(string tipo, double importe) { cuenta.Nombre = cmb01Cuenta.Text; if (tipo == "A") { cuenta.Saldo = cuenta.Saldo + importe; } else if (tipo == "D") { cuenta.Saldo = cuenta.Saldo - importe; } cuenta.estado = EstadoEntidad.actualizado; bool valid = new Soporte.ValidacionDatos(cuenta).validacion(); if (valid) { mensaje = cuenta.GuardarCambios(); MessageBox.Show(mensaje); } importeCuenta(tipo, importe); }