private async void Delete_OnClick(object sender, RoutedEventArgs e) { if (_STOCKS.SelectedItem == null) return; try { var card = ((OilDeliveryCard)_STOCKS.SelectedItem); var dialog = new ModernDialog { Title = "eStation", Content = "Ete vous sure de supprimer cette livraison de " + card.Supplier + " ?" }; if (dialog.ShowDialogOkCancel() != MessageBoxResult.OK) return; if (await App.Store.Oils.DeleteDelivery(card.OilDeliveryGuid)) ModernDialog.ShowMessage("Supprimer avec Success !", "eStation", MessageBoxButton.OK); else ModernDialog.ShowMessage("Erreur Inconnue !", "eStation", MessageBoxButton.OK); } catch (Exception ex) { DebugHelper.WriteException(ex); ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); } await Refresh(_currentOils); e.Handled = true; }
private async void DeleteCompany_OnClick(object sender, RoutedEventArgs e) { if (_COMPANIES.SelectedItem == null) return; try { var card = ((CompanyCard)_COMPANIES.SelectedItem); var dialog = new ModernDialog { Title = "eStation", Content = "Ete vous sure de supprimer " + card.Name + " ?" }; if (dialog.ShowDialogOkCancel() != MessageBoxResult.OK) return; if (await App.Store.Sales.Delete(card.CompanyGuid)) ModernDialog.ShowMessage("Supprimer avec Success !", "eStation", MessageBoxButton.OK); else ModernDialog.ShowMessage("Erreur Inconnue !", "eStation", MessageBoxButton.OK); } catch (Exception ex) { DebugHelper.WriteException(ex); ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); } await Refresh(); e.Handled = true; }
private void save_Executed (object sender, ExecutedRoutedEventArgs e) { try { var dialog = new ModernDialog { Title="EStation", Content="Ete vous sure de confirmer cette transaction ?" }; if(dialog.ShowDialogOkCancel()!=MessageBoxResult.OK) return; var newTransaction = (Transaction) _GRID.DataContext; if ((TransactionType) (_TRANS_TYPE.SelectedValue) == TransactionType.Expense) newTransaction.Amount = - newTransaction.Amount; App.Store.Economat.Finance.NewTransaction(newTransaction); } catch (Exception ex) { ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); } ModernDialog.ShowMessage("Enregistrer avec Success !", "EStation", MessageBoxButton.OK); e.Handled=true; Close(); }
private async void Delete_OnClick(object sender, RoutedEventArgs e) { var menuItem = (MenuItem)e.Source; var menu = (ContextMenu)menuItem.Parent; var list = (ListBox)menu.PlacementTarget; if (list?.SelectedItem == null) return; try { var card = ((PompeCard)list.SelectedItem); var dialog = new ModernDialog { Title = "eStation", Content = "Ete vous sure de supprimer " + card.Libel + " ?" }; if (dialog.ShowDialogOkCancel() != MessageBoxResult.OK) return; if (await App.Store.Pompes.Delete(card.PompeGuid)) ModernDialog.ShowMessage("Supprimer avec Success !", "eStation", MessageBoxButton.OK); else ModernDialog.ShowMessage("Erreur Inconnue !", "eStation", MessageBoxButton.OK); } catch (Exception ex) { DebugHelper.WriteException(ex); ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); } await Refresh(); e.Handled = true; }
private async void DeletePay_Click(object sender, RoutedEventArgs e) { if (_PURCHASES.SelectedValue == null || _PURCHASES.SelectedItem == null) return; try { var payCard = ((PurchaseCard)_PURCHASES.SelectedItem); var dialog = new ModernDialog { Title = "eStation", Content = "Ete vous sure de Supprimer cet Bon de " + payCard.Company + " ?" }; if (dialog.ShowDialogOkCancel() != MessageBoxResult.OK) return; if (await App.Store.Sales.DeletePurchase(payCard.PurchaseGuid)) ModernDialog.ShowMessage("Supprimer avec Success !", "eStation", MessageBoxButton.OK); else ModernDialog.ShowMessage("Erreur Inconnue !", "eStation", MessageBoxButton.OK); } catch (Exception ex) { DebugHelper.WriteException(ex); ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); } await Refresh(_companiesGuids, _fromDate, _toDate); e.Handled = true; }
private void Archiver_OnClick (object sender, RoutedEventArgs e) { var menuItem = (MenuItem)e.Source; var menu = (ContextMenu)menuItem.Parent; var list = (ListBox)menu.PlacementTarget; if(list?.SelectedValue==null) return; var dialog = new ModernDialog { Title="EStation", Content="Ete vous sure de supprimer "+ ((Staff)list.SelectedItem).Person.FullName +" de la base de donneé" }; if(dialog.ShowDialogOkCancel()!=MessageBoxResult.OK) return; try { App.Store.HumanResource.DeleteStaff((Guid) list.SelectedValue); } catch (SecurityException) { ModernDialog.ShowMessage("Permission Refusée", "ERREUR", MessageBoxButton.OK); return; } catch (Exception ex) { ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); return; } ModernDialog.ShowMessage("Archiver avec Success !", "EStation", MessageBoxButton.OK); }
private void Archiver_OnClick(object sender, RoutedEventArgs e) { if (_CLIENT_LIST?.SelectedItem == null) return; var dialog = new ModernDialog { Title = "EStation", Content = "Ete vous sure de supprimer " + ((CustomerCard)_CLIENT_LIST.SelectedItem).FullName + " de la base de donneé" }; if (dialog.ShowDialogOkCancel() != MessageBoxResult.OK) return; try { App.Store.Customers.Delete((Guid)_CLIENT_LIST.SelectedValue); } catch (SecurityException) { ModernDialog.ShowMessage("Permission Refusée", "ERREUR", MessageBoxButton.OK); return; } catch (Exception ex) { ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); return; } ModernDialog.ShowMessage("Archiver avec Success !", "EStation", MessageBoxButton.OK); }