本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}