private void OnLogEntryEdited(CreateEditLogEntryPage page, DreamLogEntryViewModel model) { DreamLogEntry original = datalayer.GetLogEntry(model.EntryId); original.Update(model); if (this.datalayer.SaveChanges() > 0) { this.LoadItems(); } this.IsBusy = false; }
private void OnLogEntryCreated(CreateEditLogEntryPage page, DreamLogEntryViewModel model) { DreamLogEntry entry = model.Copy <DreamLogEntry>(); if (entry.FK_CategoryId == -1) { entry.FK_CategoryId = null; entry.Category = null; } entry.Log = this.datalayer.DreamLogCollections.First(); entry.FK_LogId = entry.Log.LogId; entry.CreatedAt = DateTime.Now; if (this.datalayer.AddLogEntry(entry)) { this.LoadEntriesCommand.Execute(null); } this.IsBusy = false; }