protected async System.Threading.Tasks.Task Grid0RowSelect(Flashcardgenerator.Models.Localhost.Card args) { var dialogResult = await DialogService.OpenAsync <EditCard>("Edit Card", new Dictionary <string, object>() { { "cardId", args.cardId } }); await grid0.Reload(); await InvokeAsync(() => { StateHasChanged(); }); }
public async Task <Models.Localhost.Card> CancelCardChanges(Models.Localhost.Card item) { var entityToCancel = Context.Entry(item); entityToCancel.CurrentValues.SetValues(entityToCancel.OriginalValues); entityToCancel.State = EntityState.Unchanged; return(item); }
public async Task <Models.Localhost.Card> CreateCard(Models.Localhost.Card card) { OnCardCreated(card); Context.Cards.Add(card); Context.SaveChanges(); OnAfterCardCreated(card); return(card); }
protected async System.Threading.Tasks.Task Form0Submit(Flashcardgenerator.Models.Localhost.Card args) { try { var localhostCreateCardResult = await Localhost.CreateCard(card); DialogService.Close(card); } catch (System.Exception localhostCreateCardException) { NotificationService.Notify(new NotificationMessage() { Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to create new Card!" }); } }
protected async System.Threading.Tasks.Task Form0Submit(Flashcardgenerator.Models.Localhost.Card args) { try { var localhostUpdateCardResult = await Localhost.UpdateCard(cardId, card); DialogService.Close(card); } catch (System.Exception localhostUpdateCardException) { NotificationService.Notify(new NotificationMessage() { Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to update Card" }); hasChanges = localhostUpdateCardException is DbUpdateConcurrencyException; } }
protected async System.Threading.Tasks.Task Load() { var localhostGetBriefsResult = await Localhost.GetBriefs(); getBriefsForbriefIdResult = localhostGetBriefsResult; var localhostGetCategoriesResult = await Localhost.GetCategories(); getCategoriesForcategoryIdResult = localhostGetCategoriesResult; var localhostGetSentencesResult = await Localhost.GetSentences(); getSentencesForsentenceIdResult = localhostGetSentencesResult; card = new Flashcardgenerator.Models.Localhost.Card() { }; }
public async Task <Models.Localhost.Card> UpdateCard(int?cardId, Models.Localhost.Card card) { OnCardUpdated(card); var itemToUpdate = Context.Cards .Where(i => i.cardId == cardId) .FirstOrDefault(); if (itemToUpdate == null) { throw new Exception("Item no longer available"); } var entryToUpdate = Context.Entry(itemToUpdate); entryToUpdate.CurrentValues.SetValues(card); entryToUpdate.State = EntityState.Modified; Context.SaveChanges(); OnAfterCardUpdated(card); return(card); }
protected async System.Threading.Tasks.Task Load() { var localhostGetBriefsResult = await Localhost.GetBriefs(new Query() { Filter = $@"briefId eq ""{Globals.selectedBriefId}""" }); getBriefsResult = localhostGetBriefsResult; var localhostGetCategoriesResult = await Localhost.GetCategories(); getCategoriesResult = localhostGetCategoriesResult; var localhostGetSentencesResult = await Localhost.GetSentences(); getSentencesResult = localhostGetSentencesResult; card = new Flashcardgenerator.Models.Localhost.Card() { }; if (string.IsNullOrEmpty(search)) { search = ""; } var localhostGetCardsResult = await Localhost.GetCards(new Query() { Filter = $@"briefId eq ""{Globals.selectedBriefId}""", Expand = "Brief,Category,Sentence" }); getCardsResult = localhostGetCardsResult; var localhostGetBriefBybriefIdResult = await Localhost.GetBriefBybriefId(Globals.selectedBriefId); briefObj = localhostGetBriefBybriefIdResult; }
protected async System.Threading.Tasks.Task Grid0RowDoubleClick(Flashcardgenerator.Models.Localhost.Card args) { await DialogService.OpenAsync <EditCard>("Edit Card", new Dictionary <string, object>() { { "cardId", args.cardId } }); }
protected async System.Threading.Tasks.Task Grid1RowSelect(Flashcardgenerator.Models.Localhost.Card args, dynamic data) { var dialogResult = await DialogService.OpenAsync <EditCard>("Edit Card", new Dictionary <string, object>() { { "cardId", args.cardId } }); await grid1.Reload(); }
partial void OnAfterCardUpdated(Models.Localhost.Card item);
partial void OnCardGet(Models.Localhost.Card item);
partial void OnAfterCardDeleted(Models.Localhost.Card item);
partial void OnCardCreated(Models.Localhost.Card item);