示例#1
0
 public override void tearDownQuery(MySession session)
 {
     if (Convert.ToBoolean(session.MdwsConfiguration.AllConfigs[MdwsConfigConstants.CONNECTION_POOL_CONFIG_SECTION][MdwsConfigConstants.CONNECTION_POOLING]))
     {
         SessionMgr.getInstance().returnConnections(session);
     }
 }
示例#2
0
        public UserTO login(string token, string username, string pwd, string permission)
        {
            MySession session = SessionMgr.getInstance().getSession(token);

            return((UserTO)QueryTemplate.getQuery(QueryType.REST).execute(session, new Func <string, string, string, UserTO>
                                                                              (new rest.AccountLib(session).login), new object[] { username, pwd, permission }));
        }
示例#3
0
        public PatientArray getPatientsByClinic(string token, string clinicId, string startDate, string stopDate)
        {
            MySession session = SessionMgr.getInstance().getSession(token);

            return((PatientArray)QueryTemplate.getQuery(QueryType.REST).execute(session, new Func <string, string, string, PatientArray>
                                                                                    (new SchedulingLib(session).getPatientsByClinic), new object[] { clinicId, startDate, stopDate }));
        }
示例#4
0
        public AppointmentTypeArray getAppointmentTypes(string token, string target)
        {
            MySession session = SessionMgr.getInstance().getSession(token);

            return((AppointmentTypeArray)QueryTemplate.getQuery(QueryType.REST).execute(session, new Func <string, AppointmentTypeArray>
                                                                                            (new SchedulingLib(session).getAppointmentTypes), new object[] { target }));
        }
示例#5
0
        public TaggedAppointmentArray getPendingAppointments(string token, string startDate)
        {
            MySession session = SessionMgr.getInstance().getSession(token);

            return((TaggedAppointmentArray)QueryTemplate.getQuery(QueryType.REST).execute(session, new Func <string, TaggedAppointmentArray>
                                                                                              (new SchedulingLib(session).getPendingAppointments), new object[] { startDate }));
        }
示例#6
0
        public HospitalLocationTO getClinicSchedulingDetails(string token, string clinicId)
        {
            MySession session = SessionMgr.getInstance().getSession(token);

            return((HospitalLocationTO)QueryTemplate.getQuery(QueryType.REST).execute(session, new Func <string, HospitalLocationTO>
                                                                                          (new SchedulingLib(session).getClinicSchedulingDetails), new object[] { clinicId }));
        }
示例#7
0
        public TaggedHospitalLocationArray getClinics(string token, string target)
        {
            MySession session = SessionMgr.getInstance().getSession(token);

            return((TaggedHospitalLocationArray)QueryTemplate.getQuery(QueryType.REST).execute(session, new Func <string, string, string, TaggedHospitalLocationArray>
                                                                                                   (new EncounterLib(session).getClinics), new object[] { "", target, "" }));
        }
示例#8
0
        public PatientTO select(string token, string pid)
        {
            MySession session = SessionMgr.getInstance().getSession(token);

            return((PatientTO)QueryTemplate.getQuery(QueryType.REST).execute(session, new Func <string, PatientTO>
                                                                                 (new PatientLib(session).select), new object[] { pid }));
        }
示例#9
0
        public AppointmentTO makeAppointment(string token, string clinicId, string appointmentTimestamp, string purpose,
                                             string purposeSubcategory, string appointmentType, string appointmentLength)
        {
            MySession session = SessionMgr.getInstance().getSession(token);

            return((AppointmentTO)QueryTemplate.getQuery(QueryType.REST).execute(session, new Func <string, string, string, string, string, string, AppointmentTO>
                                                                                     (new SchedulingLib(session).makeAppointment), new object[] { clinicId, appointmentTimestamp, purpose, purposeSubcategory, appointmentLength, appointmentType }));
        }
示例#10
0
        public static SessionMgr getInstance()
        {
            if (_mgr == null)
            {
                MySession session = new MySession(); // need this so we can read config file for connection pool
                if (Convert.ToBoolean(session.MdwsConfiguration.AllConfigs[MdwsConfigConstants.CONNECTION_POOL_CONFIG_SECTION][MdwsConfigConstants.CONNECTION_POOLING]))
                {
                    startConnectionPool();
                }

                _mgr           = new SessionMgr();
                _mgr._sessions = new Dictionary <string, MySession>();
            }
            return(_mgr);
        }
示例#11
0
        public DataSourceArray connect(string sitelist)
        {
            MySession       newSession = new MySession();
            DataSourceArray src        = new rest.ConnectionLib(newSession).connectToLoginSite(sitelist);

            if (src.fault == null) // successful connect!
            {
                newSession.Token    = SessionMgr.getInstance().getNewToken();
                newSession.LastUsed = DateTime.Now;
                SessionMgr.getInstance().addSession(newSession);

                WebOperationContext.Current.OutgoingResponse.Headers.Add("token", newSession.Token);
            }
            SessionMgr.getInstance().returnConnections(newSession);
            return(src);
        }
示例#12
0
 public TaggedTextArray disconnect(string token)
 {
     return(new rest.ConnectionLib(SessionMgr.getInstance().getSession(token)).disconnectAll());
 }