async Task SuccessFullySaved() { ClearSelections(); LoadGrid(); StateHasChanged(); await SuccessNotification.Show(); }
private async void DeleteCategoryAppButton_Click(object sender, RoutedEventArgs e) { var CurrentCategory = (Categories)CategoryBox.SelectedValue; NotificationControl SuccessNotification; DeleteCategoryDialog dialog = new DeleteCategoryDialog(); await dialog.ShowAsync(); switch (dialog.Result) { case Results.Delete: //Remove all favorites in category GifologyDatabase.DeleteImageInCategory(CurrentCategory); GifologyDatabase.DeleteCategories(CurrentCategory); SuccessNotification = Notifications.CreateNotification("SuccessNotification", "Category Deleted", "Success", false); SuccessNotification.ShowHideNotification(true); break; case Results.Keep: //Don't delete favorites GifologyDatabase.MoveImageToUncategorized(CurrentCategory); GifologyDatabase.DeleteCategories(CurrentCategory); SuccessNotification = Notifications.CreateNotification("SuccessNotification", "Category Deleted", "Success", false); SuccessNotification.ShowHideNotification(true); break; case Results.Cancel: return; default: break; } LoadCategoryList(0); }
protected async Task SaveLocation() { Db.PortDetails.Add(portForm.ToPortDetails()); await Db.SaveChangesAsync(); locations = await Db.Locations.ToArrayAsync(); portsGridView = locations .SelectMany(p => p.Ports) .Where(AreValidRecords) .Select(p => PortDetailsGridView.FromPort(p)) .ToArray(); portForm = new PortDetailsForm(); await EditorPanel.HideAsync(); await SuccessNotification.Show(); }
protected async Task SaveLocation() { Db.PortDetails.Add(portForm.ToPortDetails()); try { await Db.SaveChangesAsync(); } catch (System.Exception) { await FailNotification.Show(); } portsGridView = await LoadPortsViewModel(); portForm = new PortDetailsForm(); await EditorPanel.HideAsync(); await SuccessNotification.Show(); }