Пример #1
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (CurrentPhonebook == null)
            {
                MainWindow.WarningMessage = ((string)Application.Current.FindResource("Morate_odabrati_stavku_za_brisanjeUzvičnik"));
                return;
            }

            // Delete data
            var result = PhonebookService.Delete(CurrentPhonebook.Identifier);

            if (result.Success)
            {
                MainWindow.SuccessMessage = ((string)Application.Current.FindResource("Podaci_su_uspešno_obrisaniUzvičnik"));

                Thread displayThread = new Thread(() => SyncData());
                displayThread.IsBackground = true;
                displayThread.Start();
            }
            else
            {
                MainWindow.ErrorMessage = result.Message;
            }
        }
Пример #2
0
 public ActionResult DeleteConfirm(int id)
 {
     _phonebookService.Delete(id);
     return(RedirectToAction("Index"));
 }