当前位置: 首页>>代码示例>>C#>>正文


C# ModernDialog.ShowDialogOkCancel方法代码示例

本文整理汇总了C#中FirstFloor.ModernUI.Windows.Controls.ModernDialog.ShowDialogOkCancel方法的典型用法代码示例。如果您正苦于以下问题:C# ModernDialog.ShowDialogOkCancel方法的具体用法?C# ModernDialog.ShowDialogOkCancel怎么用?C# ModernDialog.ShowDialogOkCancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FirstFloor.ModernUI.Windows.Controls.ModernDialog的用法示例。


在下文中一共展示了ModernDialog.ShowDialogOkCancel方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Delete_OnClick

        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;
        }
开发者ID:HalidCisse,项目名称:eStation,代码行数:29,代码来源:OilDelivery.xaml.cs

示例2: DeleteCompany_OnClick

        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;
        }
开发者ID:HalidCisse,项目名称:eStation,代码行数:29,代码来源:Companies.xaml.cs

示例3: save_Executed

        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();
        }
开发者ID:HalidCisse,项目名称:eStation,代码行数:24,代码来源:AddTransaction.xaml.cs

示例4: Delete_OnClick

        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;
        }
开发者ID:HalidCisse,项目名称:eStation,代码行数:32,代码来源:ColonneView.xaml.cs

示例5: DeletePay_Click

        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;
        }
开发者ID:HalidCisse,项目名称:eStation,代码行数:29,代码来源:Purchases.xaml.cs

示例6: Archiver_OnClick

        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);
        }
开发者ID:HalidCisse,项目名称:eStation,代码行数:30,代码来源:StaffsView.xaml.cs

示例7: Archiver_OnClick

        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);
        }
开发者ID:HalidCisse,项目名称:eStation,代码行数:31,代码来源:ClientsView.xaml.cs


注:本文中的FirstFloor.ModernUI.Windows.Controls.ModernDialog.ShowDialogOkCancel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。