コード例 #1
0
        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);
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            var theClass = App.DataS.Pedagogy.Classes.GetClasseById(_currentSelected);

            var theName = "Ete Vous Sure de supprimer " + theClass.Name + " definitivement ?";

            var md = new ModernDialog {
                Title = "Matrix", Content = theName
            };

            var r = md.ShowDialogOkCancel();

            if (r != MessageBoxResult.OK)
            {
                return;
            }

            try
            {
                App.DataS.Pedagogy.Classes.DeleteClasse(theClass.ClasseGuid);
            }
            catch (Exception ex)
            {
                ModernDialog.ShowMessage(ex.Message, "Matrix", MessageBoxButton.OK);
                return;
            }

            if (App.DataS.Pedagogy.Filieres.GetFiliereClassCount(theClass.FiliereGuid) < 1)
            {
                if (MessageBox.Show("Vouler Vous Supprimer " + App.DataS.Pedagogy.Filieres.GetFiliereById(theClass.FiliereGuid).Name + " definitivement ?") != MessageBoxResult.Yes)
                {
                    return;
                }

                try
                {
                    App.DataS.Pedagogy.Filieres.DeleteFiliere(theClass.FiliereGuid);
                }
                catch (Exception ex)
                {
                    ModernDialog.ShowMessage(ex.Message, "Matrix", MessageBoxButton.OK);
                    return;
                }
            }
            Refresh();
        }
コード例 #5
0
        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;
        }
コード例 #6
0
        private async void Delete_OnClick(object sender, RoutedEventArgs e)
        {
            return;

            if (_STOCKS.SelectedItem == null)
            {
                return;
            }

            try
            {
                var card = ((FuelDeliveryCard)_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.Fuels.DeleteDelivery(card.FuelDeliveryGuid))
                {
                    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(_currentCiterne);

            e.Handled = true;
        }
コード例 #7
0
        private async void Delete_OnClick(object sender, RoutedEventArgs e)
        {
            if (_HUILES.SelectedItem == null)
            {
                return;
            }

            try
            {
                var card = ((OilCard)_HUILES.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.Oils.Delete(card.OilGuid))
                {
                    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;
        }
コード例 #8
0
ファイル: Purchases.xaml.cs プロジェクト: HalidCisse/eStation
        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;
        }
コード例 #9
0
        private void ClassContextDel_Click(object sender, RoutedEventArgs e)
        {
            var list = ((FrameworkElement)sender).Tag as ListBox;

            if (list?.SelectedValue == null)
            {
                return;
            }

            var theName = App.DataS.Pedagogy.Classes.GetClasseName(new Guid(list.SelectedValue.ToString()));

            theName = "Ete Vous Sure de supprimer " + theName + " definitivement ?";

            var md = new ModernDialog {
                Title = "Matrix", Content = theName
            };

            var r = md.ShowDialogOkCancel();

            if (r != MessageBoxResult.OK)
            {
                return;
            }

            try
            {
                App.DataS.Pedagogy.Classes.DeleteClasse(new Guid(list.SelectedValue.ToString()));
            }
            catch (Exception ex)
            {
                ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK);
                return;
            }

            ModernDialog.ShowMessage("Supprimer Avec Success", "Matrix", MessageBoxButton.OK);

            Refresh();
        }