示例#1
0
        public ReportGenerator(List <Event> events,
                               HumanRepository humanRepository,
                               GateRepositoryLocal gateRepositoryLocal)

        {
            _events              = events;
            _humanRepository     = humanRepository;
            _gateRepositoryLocal = gateRepositoryLocal;
        }
示例#2
0
        public bool TryPass(int humanId, int gateId)
        {
            Event _event = new Event();

            _event.HumanId = humanId;
            _event.GateId  = gateId;
            _event.Date    = DateTime.Now;
            bool hasRight = false;

            Human human = new HumanRepository().Retrieve(humanId);

            foreach (var oneRight in human.GateIdRights)
            {
                if (oneRight == gateId)
                {
                    hasRight = true;
                }
            }
            _event.Pass = hasRight;
            events.Add(_event);
            return(hasRight);
        }