protected void grdListaDDTFornitori_RowCommand(object sender, GridViewCommandEventArgs e) { int id = Convert.ToInt32(e.CommandArgument.ToString()); hfIdDDT.Value = id.ToString(); if (e.CommandName == "ModDDT") { ModificaDDT(id); } else if (e.CommandName == "ElimDDT") { bool isDeleted = DDTFornitoriDAO.DeleteDDTFornitore(id); if (isDeleted) { lblError.Text = "DDT Fornitore con id = " + id + ", eliminato con successo"; lblError.ForeColor = Color.Blue; } else { lblError.Text = "NON è stato possibile eliminare il DDT Fornitore con id = " + id; lblError.ForeColor = Color.Red; } } BindGrid(); }