Example #1
0
        private async void DeleteMethod()
        {
            MessageDialogResult result = await _currentWindow.ShowMessageAsync("تأكيد الحذف", "هل تـريــد حــذف هـذا العميل؟", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings()
            {
                AffirmativeButtonText = "موافق",
                NegativeButtonText    = "الغاء",
                DialogMessageFontSize = 25,
                DialogTitleFontSize   = 30
            });

            if (result == MessageDialogResult.Affirmative)
            {
                if (_clientServ.IsExistInClientAccounts(_selectedClient.ID) || _clientServ.IsExistInClientInfo(_selectedClient.ID) || _clientServ.IsExistInSales(_selectedClient.ID) || _clientServ.IsExistInSupplies(_selectedClient.ID))
                {
                    await _currentWindow.ShowMessageAsync("فشل الحذف", "لا يمكن حذف هذا العميل", MessageDialogStyle.Affirmative, new MetroDialogSettings()
                    {
                        AffirmativeButtonText = "موافق",
                        DialogMessageFontSize = 25,
                        DialogTitleFontSize   = 30
                    });

                    return;
                }
                _clientServ.DeleteClient(_selectedClient);
                clients.Remove(_selectedClient);
                GetCurrentPage();
            }
        }
Example #2
0
 public void Delete(int id)
 {
     try
     {
         var clienteService = new ClientServices();
         {
             clienteService.DeleteClient(id);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        private async void DeleteMethod()
        {
            MessageDialogResult result = await _currentWindow.ShowMessageAsync("تأكيد الحذف", "هل تـريــد حــذف هـذا العميل؟", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings()
            {
                AffirmativeButtonText = "موافق",
                NegativeButtonText    = "الغاء",
                DialogMessageFontSize = 25,
                DialogTitleFontSize   = 30
            });

            if (result == MessageDialogResult.Affirmative)
            {
                _selectedClient = _clientServ.GetClient(_selectedClientVM.ID);
                _clientServ.DeleteClient(_selectedClient);
                Load();
            }
        }
 public ActionResult Deleteclient(int id)
 {
     cs.DeleteClient(id);
     TempData["msg"] = "<script>alert('Delete Complain');</script>";
     return(Redirect("/Admin/allCliernts"));
 }
 public IActionResult DeleteClient(Guid id)
 {
     ClientServices.DeleteClient(id);
     return(NoContent());
 }