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.");
                }
            }
        }
Exemplo n.º 2
0
        protected void PrestamoGridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            ReporsitorioPrestamos rep = new ReporsitorioPrestamos();

            PrestamoGridView.DataSource = rep.GetList(filter);
            PrestamoGridView.PageIndex  = e.NewPageIndex;
            PrestamoGridView.DataBind();
        }
Exemplo n.º 3
0
        protected void BuscarLinkButton_Click(object sender, EventArgs e)
        {
            ReporsitorioPrestamos rep = new ReporsitorioPrestamos();

            Filtrar();
            lista = rep.GetList(filter);
            PrestamoGridView.DataSource = lista;
            PrestamoGridView.DataBind();
        }
Exemplo n.º 4
0
        protected void BuscarLinkButton_Click(object sender, EventArgs e)
        {
            ReporsitorioPrestamos rep       = new ReporsitorioPrestamos();
            Prestamos             prestamos = rep.Buscar(ToInt(PrestamosIdTextBox.Text));

            if (prestamos != null)
            {
                LlenarCampos(prestamos);
                SeBusco = true;
                ViewState["SeBusco"] = SeBusco;
            }
            else
            {
                CallModal("Este Prestamo no Existe");
            }
        }
Exemplo n.º 5
0
        protected void EliminarLinkButton_Click(object sender, EventArgs e)
        {
            ReporsitorioPrestamos rep       = new ReporsitorioPrestamos();
            Prestamos             prestamos = rep.Buscar(ToInt(PrestamosIdTextBox.Text));

            if (prestamos != null)
            {
                if (rep.Eliminar(ToInt(PrestamosIdTextBox.Text)))
                {
                    CallModal("Prestamo eliminado");
                    LimpiarCampos();
                }
                else
                {
                    CallModal("El prestamo no pudo ser eliminado");
                }
            }
        }