protected void ButtonDeletePublication_Click(object sender, EventArgs e) { PublicationsDAL.DeletePublication(selectedPublication.PairsFieldValue["tag"]); Find(); GridViewResults.SelectedIndex = 0; foreach (var publication in PublicationsDAL.PublicationsAll) { if (publication.Klucz == (string)GridViewResults.SelectedValue) { selectedPublication = new Publication(publication.PairsFieldValue); ShowInfo(selectedPublication); break; } } Response.Write("<script>alert('Publikacja została usunięta')</script>"); }
protected void ButtonDelete_Click(object sender, EventArgs e) { PublicationsDAL.DeletePublication(selectedPublication.PairsFieldValue["tag"]); GridViewPublications.DataSource = PublicationsDAL.PublicationsAll = PublicationsDAL.GetPublications($"SELECT * FROM publications " + $"ORDER BY {DDListSortMethod.SelectedValue}"); GridViewPublications.DataBind(); GridViewPublications.SelectedIndex = 0; foreach (var publication in PublicationsDAL.PublicationsAll) { if (publication.Klucz == (string)GridViewPublications.SelectedValue) { selectedPublication = new Publication(publication.PairsFieldValue); ShowInfo(selectedPublication); break; } } Response.Write("<script>alert('Publikacja została usunięta')</script>"); }