public bool TryPass(int humanId, int gateId) { Human human = humanRepository.Retrieve(humanId); bool hasRight = human.HasRight(gateId); events.Add(new Event(Guid.NewGuid(), humanId, gateId, DateTime.Now, hasRight)); return(hasRight); }
public List <ReportEvent> GenerateTotalEvents() { List <ReportEvent> totalEventAtaskaita = new List <ReportEvent>(); foreach (var item in bandymaiPraeiti) { Human human = humanRepository.Retrieve(item.HumanId); Gate gate = gateRepository.Retrieve(item.GateId); ReportEvent reportEvent = new ReportEvent(human.Name, gate.Code, item.Date, item.Pass); totalEventAtaskaita.Add(reportEvent); } return(totalEventAtaskaita); }