Exemple #1
0
 protected void btnEliminar_Click(object sender, EventArgs e)
 {
     foreach (GridViewRow row in gvAlbums.Rows)
     {
         if (txtID.Text == row.Cells[0].Text)
         {
             daoAlbum.eliminar(Int32.Parse(txtID.Text));
             gvAlbums.DataSource = daoAlbum.obtenerTodos();
             gvAlbums.DataBind();
         }
     }
 }
        protected void buttonsCard_click(object sender, EventArgs e)
        {
            string algo = ((HtmlAnchor)sender).ClientID;

            if (algo.Contains("btnEdit"))
            {
                string idStr = algo.Replace("btnEdit", "");
                Session["idAlbum"] = int.Parse(idStr);
                Response.Redirect("EdicionAlbumes.aspx", true);
            }
            else
            {
                string idStr    = algo.Replace("btnDelete", "");
                long   idDelete = long.Parse(idStr);
                daoCancion.eliminarPorAlbum(idDelete);
                daoAlbum.eliminar(idDelete);
                albumContainer.InnerHtml = "";
                chargeData();
            }
        }