Ejemplo n.º 1
0
        public string next(DOCTOR_SAY_NEXT next)
        {
            try
            {
                HttpClient httpClient = new HttpClient();
                httpClient.MaxResponseContentBufferSize = 256000;
                httpClient.Timeout = TimeSpan.FromSeconds(3);
                String url = ip + "/iQueue/change";

                var values = new List <KeyValuePair <string, string> >();
                values.Add(new KeyValuePair <string, string>("opcode", next.opcode));
                values.Add(new KeyValuePair <string, string>("newQueueId", next.newQueueId));
                values.Add(new KeyValuePair <string, string>("pId", next.pId));

                var content = new FormUrlEncodedContent(values);
                HttpResponseMessage response = new HttpResponseMessage();
                response = httpClient.PostAsync(new Uri(url), content).Result;
                String result = response.Content.ReadAsStringAsync().Result;
                return(result);
            }
            catch
            {
                return("unable to connect server:timeout(3)");
            }
        }
Ejemplo n.º 2
0
 public string Send_action(object pb)
 {
     if (pb is User)
     {
         INITIALIZE user_info = new INITIALIZE();
         user_info.user = (User)pb;
         return(login(user_info));
     }
     else if (pb is PatientInfo)
     {
         ADD_PATIENT ap = new ADD_PATIENT();
         ap.info = (PatientInfo)pb;
         return(add_patient(ap));
     }
     else if (pb is ToQueue)
     {
         DOCTOR_SAY_NEXT ap = new DOCTOR_SAY_NEXT();
         ap.pId        = ((ToQueue)pb).pId;
         ap.newQueueId = ((ToQueue)pb).queueId;
         return(next(ap));
     }
     else if (pb is TriageOffice)
     {
         TRIAGE_OFFICE ap = new TRIAGE_OFFICE();
         ap.pId      = ((TriageOffice)pb).pId;
         ap.clinicId = ((TriageOffice)pb).clinicId;
         return(triage(ap));
     }
     else
     {
         return("invalid sending object");
     }
 }
Ejemplo n.º 3
0
 public string Send_action(object pb)
 {
     if (pb is User)
     {
         INITIALIZE user_info = new INITIALIZE();
         user_info.user = (User)pb;
         return(login(user_info));
     }
     else if (pb is PatientInfo)
     {
         ADD_PATIENT ap = new ADD_PATIENT();
         ap.info = (PatientInfo)pb;
         return(add_patient(ap));
     }
     else if (pb is String)
     {
         DOCTOR_SAY_NEXT ap = new DOCTOR_SAY_NEXT();
         ap.name = (String)pb;
         return(next(ap));
     }
     else
     {
         return("invalid sending object");
     }
 }