Exemple #1
0
        public List <Visit> GetVisits()
        {
            var token = tokenManager.FindOrAddToken();

            if (tokenManager.IsTockenPaymentValid(token, Functions.Get))
            {
                var dao = VisitDao.instanceOf();
                return(dao.GetVisit());
            }

            throw new TokenNotFoundException("Payment or token not found. Operation GetVisits in Polyclinic Service");
        }
Exemple #2
0
        public bool CreateVisit(Visit visit)
        {
            var token = tokenManager.FindOrAddToken();

            if (tokenManager.IsTockenPaymentValid(token, Functions.Create))
            {
                var dao = VisitDao.instanceOf();
                dao.CreateVisit(visit);
                return(true);
            }

            throw new TokenNotFoundException("Payment or token not found. Operation CreateVisits in Polyclinic Service");
        }