private void buttonActualizar_Click(object sender, EventArgs e) { var objeto = this.gui2prestamo(); if (objeto == null) { MessageBox.Show("Problemas al extraer desde la base de datos"); return; } objeto.Id = this.gPrestamo.Id; objeto.Usuario_creador = this.gPrestamo.Usuario_creador; objeto.Fecha_creacion = this.gPrestamo.Fecha_creacion; objeto.Usuario_modificador = this.gUsuario; objeto.Fecha_modificacion = BLFechaHoraServidor.Obtener(); if (MessageBox.Show("Se va a proceder a refinanciar la deuda, Esto no se puede revertir, ¿Desea continuar?", "Advertencia", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (this.BLPrestamo.Prestamo_Editar(objeto)) { MessageBox.Show("La deuda ha sido refinanciada correctamente"); this.clearForm(); this.modoInicial(); } } }
private void buttonActualizar_Click(object sender, EventArgs e) { var objeto = this.gui2chequera(); if (objeto == null) { MessageBox.Show("Problemas al instanciar el nuevo objeto, revise las propiedas"); return; } objeto.Numero = this.gChequera.Numero; objeto.Cantidad_cheques = this.gChequera.Cantidad_cheques; objeto.Inicio = this.gChequera.Inicio; objeto.Usuario_creador = this.gChequera.Usuario_creador; objeto.Fecha_creacion = this.gChequera.Fecha_creacion; objeto.Usuario_modificador = this.gChequera.Usuario_modificador; objeto.Fecha_modificacion = BLFechaHoraServidor.Obtener(); if (this.BLChequeras.Update(objeto)) { MessageBox.Show("El proceso ha sido correcto"); this.clearForm(); this.modoInicial(); } }
private void buttonActualizar_Click(object sender, EventArgs e) { var objeto = this.gui2tarjeta(); if (objeto == null) { //MessageBox.Show("Problemas al instanciar el nuevo objeto, revise las propiedas"); alertTarjeta.Show(MessageType.ERROR, "Problemas al instanciar el nuevo objeto, revise las propiedas"); return; } objeto.Numero = this.gtarjeta.Numero; objeto.Usuario_creador = this.gtarjeta.Usuario_creador; objeto.Fecha_creacion = this.gtarjeta.Fecha_creacion; objeto.Usuario_modificador = this.gUsuario; objeto.Fecha_modificacion = BLFechaHoraServidor.Obtener(); if (this.BLTarjeta.Update(objeto)) { alertTarjeta.Show(MessageType.SUCCESSFUL, "Se actualizo correctamente la tarjeta"); //MessageBox.Show("El proceso ha sido correcto"); this.clearForm(); this.modoInicial(); } }
private void buttonActualizar_Click(object sender, EventArgs e) { var objeto = this.gui2moneda(); if (objeto == null) { MessageBox.Show("Se detectan algunas incoherencias, por favor ingresa valores correctos"); return; } objeto.Id = this.gMoneda.Id; objeto.Usuario_creador = this.gMoneda.Usuario_creador; objeto.Fecha_creacion = this.gMoneda.Fecha_creacion; objeto.Usuario_modificador = this.gUsuario; objeto.Fecha_modificacion = BLFechaHoraServidor.Obtener(); DialogResult result = MessageBox.Show("¿Está seguro que quiere cambiar los valores? Puede afectar las futuras transacciones", "Advertencia", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { if (this.BLMoneda.Update(objeto)) { MessageBox.Show("El proceso ha sido correcto"); this.clearForm(); this.modoInicial(); } } }
private void buttonActualizar_Click(object sender, EventArgs e) { var objeto = this.gui2chequera(); if (objeto == null) { alert1.Show(Controles.MessageType.ERROR, "Problemas al instanciar el nuevo objeto, revise las propiedas"); return; } objeto.Numero = this.gChequera.Numero; objeto.Cantidad_cheques = this.gChequera.Cantidad_cheques; objeto.Inicio = this.gChequera.Inicio; objeto.Usuario_creador = this.gChequera.Usuario_creador; objeto.Fecha_creacion = this.gChequera.Fecha_creacion; objeto.Usuario_modificador = this.gChequera.Usuario_modificador; objeto.Fecha_modificacion = BLFechaHoraServidor.Obtener(); if (gChequera.Estado == "SOLICITADA") { int cantidadCheques = BLChequeras.CantidadCheques(objeto.Id_cuenta); if (cantidadCheques < 1) { if (this.BLChequeras.Update(objeto)) { GenerarCheques(objeto.Fecha_creacion); } } alert1.Show(Controles.MessageType.SUCCESSFUL, "El proceso se ejecuto correctamente"); this.clearForm(); this.modoInicial(); } }
private void buttonActualizar_Click(object sender, EventArgs e) { var objeto = this.gui2persona(); if (objeto == null) { //MessageBox.Show("Problemas al instanciar el nuevo objeto, revise las propiedas"); alertUsuario.Show(MessageType.ERROR, "Problemas al instanciar el nuevo objeto, revise las propiedas"); return; } objeto.Id = this.gPerona.Id; objeto.Usuario_creador = this.gPerona.Usuario_creador; objeto.Fecha_creacion = this.gPerona.Fecha_creacion; objeto.Usuario_modificador = this.gusuario; objeto.Fecha_modificacion = BLFechaHoraServidor.Obtener(); if (this.BLPersona.Persona_Editar(objeto)) { //MessageBox.Show("Se actualizo Correctamente");//("El proceso ha sido correcto"); alertUsuario.Show(MessageType.SUCCESSFUL, "se actualizo correctamente la información"); this.clearForm(); this.modoInicial(); } }
private PrestamosModel gui2prestamo() { try { var objcuenta = this.BLCuenta.Cuenta_ObtenerUno(this.gCuenta.Nrocuenta); DateTime fechaPrestamo = this.dtpFechaPrestamo.Value; decimal montoPrestamo = Convert.ToDecimal(this.txtMontoPrestamo.Text); int moneda = (int)this.cboMoneda.SelectedValue; int plazoMeses = Convert.ToInt32(this.nudPlazoMeses.Value); decimal porcentaje_Interes = Convert.ToInt32(this.nudPorcentajeInteres.Value); bool seguro = this.chkEstado.Checked; string cuenta = objcuenta.Nrocuenta; decimal? interes_Moratorio = Convert.ToDecimal(this.txtMontoMora.Text); int? DiaPago = Convert.ToInt32(this.nudDiaPago.Value); string USUARIO_CREADOR = this.gUsuario; DateTime FECHA_CREACION = (DateTime)BLFechaHoraServidor.Obtener(); if (montoPrestamo < 100 || montoPrestamo > 400000) { //MessageBox.Show("Montos incorrectos, ingrese un monto entre 100 y 400 000"); alertPrestamo.Show(MessageType.ERROR, "Montos incorrectos, ingrese un monto entre 100 y 400 000"); return(null); } return(new PrestamosModel() { Fechaprestamo = fechaPrestamo, Montoprestamo = montoPrestamo, Moneda = moneda, Plazomeses = plazoMeses, Porcentaje_interes = porcentaje_Interes, Seguro = seguro, Cuenta = cuenta, Interes_moratorio = interes_Moratorio, Usuario_creador = USUARIO_CREADOR, Fecha_creacion = FECHA_CREACION, Diapago = DiaPago, }); } catch (Exception) { return(null); } }
private TipoMonedaModel gui2moneda() { try { string descripcion = this.txtDescripcion.Text; return(new TipoMonedaModel() { Nombre = descripcion, Usuario_creador = this.gUsuario, Fecha_creacion = (DateTime)BLFechaHoraServidor.Obtener(), }); } catch (Exception) { return(null); } }
private ChequerasModel gui2chequera() { try { return(new ChequerasModel() { Id_cuenta = this.gCuenta.Nrocuenta, Fecharegistro = this.dtpFechaRegistro.Value, Cantidad_cheques = (int)this.cboCantidadCheques.SelectedValue, Estado = (string)this.cboEstado.SelectedValue, Inicio = (int)this.nudChequeInicial.Value, Usuario_creador = this.gUsuario, Fecha_creacion = (DateTime)BLFechaHoraServidor.Obtener(), }); } catch (Exception) { return(null); } }
private PersonaModel gui2persona() { try { if (!Email_correcto(txtCorreo.Text)) { //MessageBox.Show("El email no es correcto"); alertUsuario.Show(MessageType.ERROR, "El email no es correcto"); return(null); } string nombres = this.txtNombres.Text; string apellidos = this.txtApellidos.Text; DateTime fecha_nacimiento = this.dtpFecha_nacimiento.Value; //int id_tipo_documento = (int)this.cboTipo_documento.SelectedValue; string numero_documento = this.txtNumero_documento.Text; string correo_electronico = this.txtCorreo.Text; bool estado = this.chkEstado.Checked; string rol_persona = (string)this.cboTipoPersona.SelectedValue; string telefono = this.txtTelefono.Text; return(new PersonaModel() { Nombres = nombres, Apellidos = apellidos, // Tipodocumento = id_tipo_documento, Correo = correo_electronico, Estado = estado, Fechanacimiento = fecha_nacimiento, Nrodocumento = numero_documento, Usuario_creador = this.gusuario, Fecha_creacion = (DateTime)BLFechaHoraServidor.Obtener(), Tipo_persona = rol_persona, Telefono = telefono }); } catch (Exception) { return(null); } }
private TarjetaModel gui2tarjeta() { if (this.gcuenta == null) { return(null); } try { return(new TarjetaModel() { Id_cuenta = this.gcuenta.Nrocuenta, Codcontrol = Convert.ToInt32(this.txtCodigoControl.Text), Password = Convert.ToInt32(this.txtPassword.Text), Fechavencimiento = this.dtpFechaVencimiento.Value, Estado = this.chkEstado.Checked, Usuario_creador = this.gUsuario, Fecha_creacion = (DateTime)BLFechaHoraServidor.Obtener() }); } catch (Exception) { return(null); } }
public DateTime?ObtenerFechaHoraActual() { return(BLFechaHoraServidor.Obtener()); }