private static string GenerateMessage(DatabaseLogic.DataController dc, Item item) { List <Magazine> l = dc.GetEntries <Magazine>().Where(m => m.Genre == item || m.marketOwner == item).ToList(); string message = $"\nCannot delete {item.Name}\nDependees:\n"; foreach (Magazine m in l) { message += $"{m.Id} {m.Name}\n"; } return(message); }
private static string GenerateMessage(DatabaseLogic.DataController dc, Person person) { List <Magazine> l = dc.GetEntries <Magazine>().Where(m => m.userOwner == person || m.Author == person).ToList(); string message = $"\nCannot delete {person.FirstName} {person.LastName}\nDependees:\n"; foreach (Magazine m in l) { message += $"{m.Id} {m.Name}\n"; } return(message); }
public EntryDependsOnDeletedItem(DatabaseLogic.DataController dc, Person person) : base(GenerateMessage(dc, person)) { }
public EntryDependsOnDeletedItem(DatabaseLogic.DataController dc, Item item) : base(GenerateMessage(dc, item)) { }