Exemplo n.º 1
0
        protected void GuardarLinkButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                if (IsAmortizacionCalculada())
                {
                    ReporsitorioPrestamos rep = new ReporsitorioPrestamos();

                    Prestamos prestamo = rep.Buscar(ToInt2(PrestamosIdTextBox.Text));

                    if (prestamo == null)
                    {
                        if (rep.Guardar(LlenaClase()))
                        {
                            CallModal("Prestamo registrado" + LlenaClase().Detalle.Count);
                            LimpiarCampos();
                        }
                    }
                    else
                    {
                        if (rep.Modificar(LlenaClase()))
                        {
                            CallModal("El prestamo a sido modifiado.");
                            LimpiarCampos();
                        }
                    }
                }
                else
                {
                    CallModal("La amortizacion no a sido calculada.");
                }
            }
        }