예제 #1
0
        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;
        }