Ejemplo n.º 1
0
    protected async void gvBooks_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "eliminar")
        {

            serviceDAO service = new serviceDAO();
            try
            {
                List<Book> book = await service.GetBook(Convert.ToInt32(gvBooks.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text));
                service.DeleteBook(book[0]);
                await loadBooks(service, 0, 0);
            }
            catch (Exception Ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "alert('An error has ocurred, please contact with your software provider');", true);
            }
        }
    }