예제 #1
0
        private void BT_GuardarPrestamo_Click(object sender, EventArgs e)
        {
            var resultadoalta = new ResultadoOp();
            var prestamo      = new Prestamo();

            prestamo.Sucursal         = sucursal;
            prestamo.Cliente          = cliente;
            prestamo.ComercioAdherido = comercio;

            if (this.TB_MontoCredito.Text == "")
            {
                prestamo.MontoCredito = 0;
            }
            else
            {
                prestamo.MontoCredito = Convert.ToInt32(this.TB_MontoCredito.Text);
            }

            if (this.TB_CantidadCuotas.Text == "")
            {
                prestamo.CantidadCuotas = 0;
            }
            else
            {
                prestamo.CantidadCuotas = Convert.ToInt32(this.TB_CantidadCuotas.Text);
            }

            I_MenuPrincipal F_MenuPrincipal = this.Owner as I_MenuPrincipal;

            if (F_MenuPrincipal != null)
            {
                resultadoalta = F_MenuPrincipal.AltaPrestamos(prestamo);
            }
            else
            {
                I_GrillaPrestamos F_GrillaPrestamos = this.Owner as I_GrillaPrestamos; //En caso de que se edite el Cliente (desde grilla)
                if (F_GrillaPrestamos != null)
                {
                    resultadoalta = F_GrillaPrestamos.AltaPrestamos(prestamo);
                }
            }
            if (resultadoalta.Resultado == true)
            {
                MessageBox.Show("La operación se realizó con éxito", "Operación completada", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                MessageBox.Show(resultadoalta.Mensaje, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #2
0
        public ResultadoOp AltaPrestamos(Prestamo prestamo)
        {
            ResultadoOp     resultadoOp     = new ResultadoOp(false, "Error interno en el servidor");
            I_MenuPrincipal F_MenuPrincipal = this.Owner as I_MenuPrincipal;

            if (F_MenuPrincipal != null)
            {
                resultadoOp = F_MenuPrincipal.AltaPrestamos(prestamo);

                if (resultadoOp.Resultado)
                {
                    ActualizarGrillaPrestamos();
                }
            }
            return(resultadoOp);
        }