protected async System.Threading.Tasks.Task Form0Submit(InnovationWebApp.Models.InnovateDb.Idea args) { try { if (isEdit) { var innovateDbUpdateIdeaResult = await InnovateDb.UpdateIdea(idea.id, idea); NotificationService.Notify(NotificationSeverity.Success, $"Success", $"Idea updated!"); } } catch (System.Exception innovateDbUpdateIdeaException) { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Idea"); } try { if (!this.isEdit) { var innovateDbCreateIdeaResult = await InnovateDb.CreateIdea(args); idea = new InnovationWebApp.Models.InnovateDb.Idea(); NotificationService.Notify(NotificationSeverity.Success, $"Success", $"Idea created!"); } } catch (System.Exception innovateDbCreateIdeaException) { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Idea!"); } }
public async Task <Models.InnovateDb.Idea> CancelIdeaChanges(Models.InnovateDb.Idea item) { var entity = context.Entry(item); entity.CurrentValues.SetValues(entity.OriginalValues); entity.State = EntityState.Unchanged; return(item); }
public async Task <Models.InnovateDb.Idea> CreateIdea(Models.InnovateDb.Idea idea) { OnIdeaCreated(idea); context.Ideas.Add(idea); context.SaveChanges(); OnAfterIdeaCreated(idea); return(idea); }
protected async System.Threading.Tasks.Task IdeaSubmit(InnovationWebApp.Models.InnovateDb.Idea args) { try { var innovateDbCreateIdeaResult = await InnovateDb.CreateIdea(idea); NotificationService.Notify(NotificationSeverity.Success, $"Success", $"Your idea has been recorded"); DialogService.Close(idea); UriHelper.NavigateTo("welcome"); } catch (System.Exception innovateDbCreateIdeaException) { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Idea!"); } }
public async Task <Models.InnovateDb.Idea> UpdateIdea(int?id, Models.InnovateDb.Idea idea) { OnIdeaUpdated(idea); var item = context.Ideas .Where(i => i.id == id) .FirstOrDefault(); if (item == null) { throw new Exception("Item no longer available"); } var entry = context.Entry(item); entry.CurrentValues.SetValues(idea); entry.State = EntityState.Modified; context.SaveChanges(); OnAfterIdeaUpdated(idea); return(idea); }
protected async System.Threading.Tasks.Task Grid0RowSelect(InnovationWebApp.Models.InnovateDb.Idea args) { isEdit = true; idea = args; }
protected async System.Threading.Tasks.Task Load() { idea = new InnovationWebApp.Models.InnovateDb.Idea() { }; }
partial void OnAfterIdeaCreated(Models.InnovateDb.Idea item);
partial void OnIdeaUpdated(Models.InnovateDb.Idea item);
partial void OnIdeaGet(Models.InnovateDb.Idea item);
partial void OnIdeaDeleted(Models.InnovateDb.Idea item);