Example #1
0
        protected void EliminarButton_Click(object sender, EventArgs e)
        {
            int id = Util.ToInt(IdPrestamoTextBox.Text);
            RepositorioPrestamo repo = new RepositorioPrestamo();

            if (repo.Eliminar(id))
            {
                Util.ShowToastr(this.Page, " Eliminado con EXITO", "Eliminado", "Success");
                Clean();
            }
            else
            {
                Util.ShowToastr(this.Page, " No se pudo eliminar", "Error", "Error");
            }
        }
Example #2
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);
                }
            }
        }