public void UnindentItem(ISublistEntry entry) { var currentParent = _entryProvider.GetParent(entry, AllEntries); if (currentParent != null) { var parentOfParent = _entryProvider.GetParent(currentParent, AllEntries); if (parentOfParent != null) { entry.ParentId = parentOfParent.Id; parentOfParent.AddSubEntrySafely(entry); currentParent.SubEntries.Remove(entry); _entryProvider.ChangeEntry(entry); } else { entry.ParentId = 0; _entryProvider.ChangeEntry(entry); currentParent.SubEntries.Remove(entry); AllEntries.Add(entry); } RefreshAllEntries(); } }
public void AddEntry(Entry entity, int todayIndex) { Db.Entries.InsertOnSubmit(entity); Db.SubmitChanges(); AllEntries.Add(entity); AllDates[todayIndex].Entries.Add(entity); }
public void CreateEntry(ISublistEntry parent) { var newEntry = new SublistEntry(); if (parent != null) { parent.AddSubEntrySafely(newEntry); } else { AllEntries.Add(newEntry); } _entryProvider.StoreNewEntry(newEntry); RefreshAllEntries(); }