I have the code below:
if (jumlahiddb < jumlahbuku)
{
DownloadBukuKomik(url);
string KomikUpdate = @"INSERT INTO books (id,title,folder_id,identifier) SELECT " + intID + ",'" + namaFile + ".pdf',67,'" + namaFile +
".pdf' WHERE not exists (select id AND title AND folder_id AND identifier FROM books WHERE id=" + intID + " and title='" + namaFile +
".pdf' AND folder_id=67 and identifier='" + namaFile + ".pdf')";
Debug.WriteLine(KomikUpdate.ToString());
var komikQuery = objConnUpdate.Prepare(KomikUpdate);
komikQuery.Step();
}
else
{
bool shown = false;
if (!shown)
{
MessageDialog messageDialog1 = new MessageDialog("Jumlah komik bertambah sebanyak " + jumlahbuku + " komik pada menu Komik Pendidikan", "Update Berhasil");
messageDialog1.Commands.Add(new UICommand("OK", (command) =>
{
DownloadBukuVideo.IsOpen = false;
Downloading.IsOpen = false;
ukomikBtn.Visibility = Visibility.Visible;
downloadKomikBtn.Visibility = Visibility.Collapsed;
ukomikText.Visibility = Visibility.Collapsed;
ukomikText.Text = "";
shown = true;
}));
await messageDialog1.ShowAsync();
}
I have a problem, that is when I click the OK button, it will display message dialog again. I want message dialog shown only 1 time. How to solve it?