void LoadOutboxes(string year) { Outboxes.Clear(); using (IUnitOfWork unit = new UnitOfWork()) { if (string.IsNullOrEmpty(year)) { var all = unit.Outboxes.GetAll().OrderByDescending(x => x.OutboxNo); foreach (var outbox in all) { Outboxes.Add(outbox); } return; } var latestOutboxes = unit.Outboxes.Query(x => x.OutboxNo.StartsWith(year)).OrderByDescending(x => x.OutboxNo); foreach (var outbox in latestOutboxes) { Outboxes.Add(outbox); } } }
private void FindSubject(string subject) { Outboxes = new ObservableCollection <Outbox>(Outboxes.Where(x => x.Subject.Contains(subject))); }
private void FindOutboxNo(string outboxNo) { Outboxes = new ObservableCollection <Outbox>(Outboxes.Where(x => x.OutboxNo.Contains(outboxNo))); }