Exemplo n.º 1
0
        protected void ButtonBuscar_Click(object sender, EventArgs e)
        {
            RepositorioPrestamo rep      = new RepositorioPrestamo();
            Prestamos           prestamo = rep.Buscar(int.Parse(TextBoxPrestamoID.Text));

            if (prestamo != null)
            {
                LlenarCampos(prestamo);
                active = true;
                ViewState["Active"] = active;
                _Visible();
            }
            else
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "Popup", "alert('Prestamo no Encontrado')", true);
            }
        }
Exemplo n.º 2
0
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            RepositorioPrestamo repo = new RepositorioPrestamo();
            var prest = repo.Buscar(Util.ToInt(IdPrestamoTextBox.Text));

            if (prest != null)
            {
                //Clean();
                LlenarCampos(prest);
                Util.ShowToastr(this.Page, "Su busqueda fue exitosa", "EXITO", "Info");
            }
            else
            {
                Util.ShowToastr(this.Page, " No existe", "Error", "Error");
                Clean();
            }
        }
Exemplo n.º 3
0
        protected void ButtonEliminar_Click(object sender, EventArgs e)
        {
            RepositorioPrestamo rep       = new RepositorioPrestamo();
            Prestamos           prestamos = rep.Buscar(int.Parse(TextBoxPrestamoID.Text));

            if (prestamos != null)
            {
                if (rep.Eliminar(int.Parse(TextBoxPrestamoID.Text)))
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "Popup", "alert('Prestamo eliminado')", true);
                    ClearAll();
                    Invisible();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "Popup", "alert('No se pudo eliminar el prestamo')", true);
                }
            }
        }