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."); } } }
protected void PrestamoGridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { ReporsitorioPrestamos rep = new ReporsitorioPrestamos(); PrestamoGridView.DataSource = rep.GetList(filter); PrestamoGridView.PageIndex = e.NewPageIndex; PrestamoGridView.DataBind(); }
protected void BuscarLinkButton_Click(object sender, EventArgs e) { ReporsitorioPrestamos rep = new ReporsitorioPrestamos(); Filtrar(); lista = rep.GetList(filter); PrestamoGridView.DataSource = lista; PrestamoGridView.DataBind(); }
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"); } }
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"); } } }