#pragma warning disable 1998
        public async Task Handle(EformCompleted message)
        {
            Appointment appo = sqlController.AppointmentFindByCaseId(message.caseId);

            outlookOnlineController.CalendarItemUpdate(appo.GlobalId, appo.Start, ProcessingStateOptions.Completed, appo.Body);
            sqlController.AppointmentsUpdate(appo.GlobalId, ProcessingStateOptions.Completed, appo.Body, "", "", true, appo.Start, appo.End, appo.Duration);
            sqlController.AppointmentSiteUpdate((int)appo.AppointmentSites.First().Id, message.caseId, ProcessingStateOptions.Completed);
        }
#pragma warning disable 1998
        public async Task Handle(AppointmentCreatedInOutlook message)
        {
            try
            {
                Appointment Appo = sqlController.AppointmentsFind(message.Appo.GlobalId);

                if (Appo.ProcessingState == ProcessingStateOptions.Processed.ToString())
                {
                    bool sqlUpdate = sqlController.AppointmentsUpdate(Appo.GlobalId, ProcessingStateOptions.Created, Appo.Body, "", "", Appo.Completed, Appo.Start, Appo.End, Appo.Duration);
                    if (sqlUpdate)
                    {
                        bool updateStatus = outlookOnlineController.CalendarItemUpdate(Appo.GlobalId, (DateTime)Appo.Start, ProcessingStateOptions.Created, Appo.Body);
                    }
                    else
                    {
                        throw new Exception("Unable to update Appointment in AppointmentCreatedInOutlookHandler");
                    }
                    //log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() L623");
                }

                eFormData.MainElement mainElement = sdkCore.TemplateRead((int)Appo.TemplateId);
                if (mainElement == null)
                {
                    log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() L625 mainElement is NULL!!!");
                }

                mainElement.Repeated = 1;
                DateTime startDt = new DateTime(Appo.Start.Year, Appo.Start.Month, Appo.Start.Day, 0, 0, 0);
                DateTime endDt   = new DateTime(Appo.End.AddDays(1).Year, Appo.End.AddDays(1).Month, Appo.End.AddDays(1).Day, 23, 59, 59);
                //mainElement.StartDate = ((DateTime)appo.Start).ToUniversalTime();
                mainElement.StartDate = startDt;
                //mainElement.EndDate = ((DateTime)appo.End.AddDays(1)).ToUniversalTime();
                mainElement.EndDate = endDt;
                //log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() L629");

                #region fill eForm
                if (Appo.AppointmentPrefillFieldValues.Count > 0)
                {
                    SetDefaultValue(mainElement.ElementList, Appo.AppointmentPrefillFieldValues);
                    string description = "";
                    foreach (AppointmentPrefillFieldValue pfv in Appo.AppointmentPrefillFieldValues)
                    {
                        eFormData.Field field      = sdkCore.Advanced_FieldRead(pfv.FieldId);
                        string          fieldValue = pfv.FieldValue;
                        if (field.FieldType == eFormShared.Constants.FieldTypes.EntitySelect)
                        {
                            fieldValue = sdkCore.EntityItemReadByMicrotingUUID(pfv.FieldValue).Name;
                        }
                        description = description + "<b>" + field.Label + ":</b> " + fieldValue + "<br>";
                    }
                    eFormShared.CDataValue cDataValue = new eFormShared.CDataValue();
                    cDataValue.InderValue = description;
                    mainElement.ElementList[0].Description = cDataValue;
                }
                #endregion


                log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() StartDate is " + mainElement.StartDate);
                log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() EndDate is " + mainElement.EndDate);
                bool allGood = false;
                List <AppoinntmentSite> appoSites = Appo.AppointmentSites;
                if (appoSites == null)
                {
                    log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() L635 appoSites is NULL!!! for appo.GlobalId" + Appo.GlobalId);
                }
                else
                {
                    foreach (AppoinntmentSite appo_site in appoSites)
                    {
                        log.LogEverything("Not Specified", "outlookController.foreach AppoinntmentSite appo_site is : " + appo_site.MicrotingSiteUid);
                        string resultId;
                        if (appo_site.MicrotingUuId == null)
                        {
                            resultId = sdkCore.CaseCreate(mainElement, "", appo_site.MicrotingSiteUid);
                            log.LogEverything("Not Specified", "outlookController.foreach resultId is : " + resultId);
                        }
                        else
                        {
                            resultId = appo_site.MicrotingUuId;
                        }

                        if (!string.IsNullOrEmpty(resultId))
                        {
                            int localCaseId = (int)sdkCore.CaseLookupMUId(resultId).CaseId;
                            //appo_site.MicrotingUuId = resultId;
                            sqlController.AppointmentSiteUpdate((int)appo_site.Id, localCaseId.ToString(), ProcessingStateOptions.Sent);
                            allGood = true;
                        }
                        else
                        {
                            log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() L656");
                            allGood = false;
                        }
                    }

                    if (allGood)
                    {
                        //log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() L663");
                        bool updateStatus = outlookOnlineController.CalendarItemUpdate(Appo.GlobalId, (DateTime)Appo.Start, ProcessingStateOptions.Sent, Appo.Body);
                        if (updateStatus)
                        {
                            //log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() L667");
                            sqlController.AppointmentsUpdate(Appo.GlobalId, ProcessingStateOptions.Sent, Appo.Body, "", "", Appo.Completed, Appo.Start, Appo.End, Appo.Duration);
                        }
                    }
                    else
                    {
                        //log.LogEverything("Not Specified", "outlookController.SyncAppointmentsToSdk() L673");
                        //syncAppointmentsToSdkRunning = false;
                    }
                }
                //}
            }
            catch (Exception ex)
            {
                log.LogEverything("Exception", "Got the following exception : " + ex.Message + " and stacktrace is : " + ex.StackTrace);
                throw ex;
            }
        }