public static VisitDao instanceOf() { if (instance == null) { instance = new VisitDao(); } return(instance); }
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"); }
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"); }