Beispiel #1
0
        ///<summary>Expire confirmations for any appointments that have been rescheduled since sending out a confirmation request.</summary>
        public static void HandleConfirmationsApptChanged()
        {
            //No remoting role check needed.
            List <ConfirmationRequest> listChanged = GetForApptChanged();
            List <string> listShortGuids           = listChanged.Where(x => !string.IsNullOrWhiteSpace(x.ShortGUID)).Select(x => x.ShortGUID).ToList();

            listShortGuids.AddRange(listChanged.Where(x => !string.IsNullOrWhiteSpace(x.ShortGuidEmail)).Select(x => x.ShortGuidEmail));
            if (listShortGuids.Count == 0)
            {
                return;
            }
            string hqPayload = WebServiceMainHQProxy.CreateWebServiceHQPayload(WebServiceMainHQProxy.CreatePayloadContent(listShortGuids, "ListShortGuids"),
                                                                               eServiceCode.ConfirmationRequest);
            string      result = WebServiceMainHQProxy.GetWebServiceMainHQInstance().HandleConfirmationsApptChanged(hqPayload);
            XmlDocument doc    = new XmlDocument();

            doc.LoadXml(result);
            XmlNode node = doc.SelectSingleNode("//Error");

            if (node != null)
            {
                throw new Exception(node.InnerText);
            }
            //Deleting these will cause the AutoComm thread to resend where necessary.
            DeleteShortGuids(listShortGuids);
        }
        ///<summary>Gets the specified number of short GUIDs</summary>
        ///<returns>First item in the Tuple is the short GUID. Second item is the URL for the short GUID if there is one for this eService.</returns>
        public static List <ShortGuidResult> GetShortGUIDs(int numberToGet, long clinicNum, eServiceCode eService)
        {
            List <PayloadItem> listPayloadItems = new List <PayloadItem> {
                new PayloadItem(clinicNum, "ClinicNum"),
                new PayloadItem(numberToGet, "NumberShortGUIDsToGet")
            };
            string officeData = WebServiceMainHQProxy.CreateWebServiceHQPayload(WebServiceMainHQProxy.CreatePayloadContent(listPayloadItems), eService);
            string result     = WebServiceMainHQProxy.GetWebServiceMainHQInstance().GenerateShortGUIDs(officeData);

            return(WebServiceMainHQProxy.DeserializeOutput <List <ShortGuidResult> >(result, "ListShortGuidResults"));
        }
Beispiel #3
0
 ///<summary>Attempts to submit an exception to HQ.
 ///Checks PrefName.SendUnhandledExceptionsToHQ prior to web call.
 ///Returns BugSubmissionResult.UpdateRequired when submitter is not on most recent stable or any version of the beta.
 ///Returns BugSubmissionResult.Failed when an error occured in the web call method.
 ///Returns BugSubmissionResult.Success when bugSubmissions was successfully created at HQ.</summary>
 public static BugSubmissionResult SubmitException(Exception ex, string threadName = "", long patNumCur = -1, string moduleName = "")
 {
     if (!PrefC.GetBool(PrefName.SendUnhandledExceptionsToHQ) ||
         _listInvalidExceptionText.Any(x => ex.Message.ToLower().Contains(x.ToLower())))
     {
         return(BugSubmissionResult.None);
     }
     return(BugSubmissions.ParseBugSubmissionResult(
                WebServiceMainHQProxy.GetWebServiceMainHQInstance().SubmitUnhandledException(
                    WebServiceMainHQProxy.CreateWebServiceHQPayload(
                        WebServiceMainHQProxy.CreatePayloadContent(
                            new BugSubmission(ex, threadName, patNumCur, moduleName), "bugSubmission")
                        , eServiceCode.BugSubmission))));
 }
Beispiel #4
0
        ///<summary>Surround with try/catch. Returns true if all messages succeded, throws exception if it failed.
        ///All Integrated Texting should use this method, CallFire texting does not use this method.</summary>
        public static bool SendSms(List <SmsToMobile> listMessages)
        {
            //No need to check RemotingRole; no call to db.
            if (Plugins.HookMethod(null, "SmsToMobiles.SendSms_start", listMessages))
            {
                return(true);
            }
            if (listMessages == null || listMessages.Count == 0)
            {
                throw new Exception("No messages to send.");
            }
            StringBuilder strbuild = new StringBuilder();

            using (XmlWriter writer = XmlWriter.Create(strbuild, WebServiceMainHQProxy.CreateXmlWriterSettings(true))){
                writer.WriteStartElement("Payload");
                writer.WriteStartElement("ListSmsToMobile");
                System.Xml.Serialization.XmlSerializer xmlListSmsToMobileSerializer = new System.Xml.Serialization.XmlSerializer(typeof(List <SmsToMobile>));
                xmlListSmsToMobileSerializer.Serialize(writer, listMessages);
                writer.WriteEndElement();                 //ListSmsToMobile
                writer.WriteEndElement();                 //Payload
            }
            string result = "";

            try {
                result = WebServiceMainHQProxy.GetWebServiceMainHQInstance()
                         .SmsSend(WebServiceMainHQProxy.CreateWebServiceHQPayload(strbuild.ToString(), eServiceCode.IntegratedTexting));
            }
            catch (Exception ex) {
                ex.DoNothing();
                throw new Exception("Unable to send using web service.");
            }
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(result);
            XmlNode node = doc.SelectSingleNode("//Error");

            if (node != null)
            {
                throw new Exception(node.InnerText);
            }
            node = doc.SelectSingleNode("//Success");
            if (node != null)
            {
                return(true);
            }
            //Should never happen, we didn't get an explicit fail or success
            throw new Exception("Unknown error has occured.");
        }