Ejemplo n.º 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();

            listChanged = listChanged.Where(x => !x.DoNotResend).ToList();          //Remove those that the user specifically said to not resend
            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 = PayloadHelper.CreatePayload(PayloadHelper.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);
        }
Ejemplo n.º 2
0
        private static GoogleToken GetAccessTokenHqOrThrow(string code, bool isRefresh)
        {
            List <PayloadItem> listPayloadItems = new List <PayloadItem> {
                new PayloadItem(code, "Code"),
                new PayloadItem(isRefresh, "IsRefreshToken"),
            };
            string officeData = PayloadHelper.CreatePayload(PayloadHelper.CreatePayloadContent(listPayloadItems), eServiceCode.OAuth);
            string result;

            try {
                result = WebServiceMainHQProxy.GetWebServiceMainHQInstance()
                         .GetGoogleAccessToken(officeData);
                return(JsonConvert.DeserializeObject <GoogleToken>(result));
            }
            catch (Exception ex) {
                throw ex;                //Purposefully rethrow here so we can handle it out a level.
            }
        }
Ejemplo n.º 3
0
        ///<summary>Attempts to submit an exception to HQ.
        ///Checks PrefName.SendUnhandledExceptionsToHQ prior to web call.</summary>
        public static BugSubmissionResult SubmitException(Exception ex, out string displayMsg, string threadName = "", long patNumCur = -1, string moduleName = "")
        {
            //No remoting role check; no call to db
            displayMsg = null;
            if (MockBugSubmissions != null)
            {
                return(MockBugSubmissions.SubmitException(ex, threadName, patNumCur, moduleName));
            }
            //Default SendUnhandledExceptionsToHQ to true if the preference cache is null or the preference was not found.
            //There might not be a database connection yet, therefore the preference cache could be null.
            //HQ needs to know more information regarding unhandled exceptions prior to setting a database connection (.NET issue, release issue, etc).
            if (!PrefC.GetBoolSilent(PrefName.SendUnhandledExceptionsToHQ, true))
            {
                return(BugSubmissionResult.None);
            }
            BugSubmission bugSubmission   = new BugSubmission(ex, threadName, patNumCur, moduleName);
            string        registrationKey = null;
            string        practiceTitle   = null;
            string        practicePhone   = null;
            string        programVersion  = null;
            string        webServiceHqURL = "";

            if (bugSubmission.RegKey == "7E57-1NPR-0DUC-710N")
            {
                registrationKey = bugSubmission.RegKey;
                practiceTitle   = "Unknown";
                practicePhone   = "Unknown";
                programVersion  = bugSubmission.Info.OpenDentBusinessVersion;
                webServiceHqURL = "https://www.patientviewer.com:49997/OpenDentalWebServiceHQ/WebServiceMainHQ.asmx";
            }
            return(ParseBugSubmissionResult(
                       WebServiceMainHQProxy.GetWebServiceMainHQInstance(webServiceHqURL).SubmitUnhandledException(
                           PayloadHelper.CreatePayload(
                               PayloadHelper.CreatePayloadContent(bugSubmission, "bugSubmission"), eServiceCode.BugSubmission, registrationKey, practiceTitle, practicePhone, programVersion
                               )
                           )
                       , out displayMsg
                       ));
        }
Ejemplo n.º 4
0
 ///<summary>Returns an XML payload that includes common information required by most HQ hosted services (e.g. reg key, program version, etc).</summary>
 ///<param name="registrationKey">An Open Dental distributed registration key that HQ has on file.  Do not include hyphens.</param>
 ///<param name="practiceTitle">Any string is acceptable.</param>
 ///<param name="practicePhone">Any string is acceptable.</param>
 ///<param name="programVersion">Typically major.minor.build.revision.  E.g. 12.4.58.0</param>
 ///<param name="listPayloadItems">All items that need to be included with the payload.</param>
 ///<param name="serviceCode">Used on case by case basis to validate that customer is registered for the given service.</param>
 ///<returns>An XML string that can be passed into an HQ hosted web method.</returns>
 public static string CreatePayload(
     List <PayloadItem> listPayloadItems, eServiceCode serviceCode, string registrationKey = null, string practiceTitle = null, string practicePhone = null, string programVersion = null)
 {
     return(CreatePayload(PayloadHelper.CreatePayloadContent(listPayloadItems), serviceCode, registrationKey, practiceTitle, practicePhone, programVersion));
 }
Ejemplo n.º 5
0
 public static string CreatePayloadWebHostSynch(string registrationKey, params PayloadItem[] listPayloadItems)
 {
     return(CreatePayload(PayloadHelper.CreatePayloadContent(listPayloadItems.ToList()), eServiceCode.WebHostSynch, registrationKey, "", "", ""));
 }