Example #1
0
        public static VisitDao instanceOf()
        {
            if (instance == null)
            {
                instance = new VisitDao();
            }

            return(instance);
        }
Example #2
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");
        }
Example #3
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");
        }