Exemple #1
0
        public string UpdateTaskInCrm(Outlook outlook)
        {
            if (!InitializeHelpers())
            {
                return("Initialize helpers fail");
            }
            TaskEntity outlookTask = exchangeHelper.GetTaskFromOutlook(outlook.outlookId);

            outlookTask.CrmId = crmHelper.GetCrmIdByOutlookId(outlookTask);
            var    isTaskNeedupdate = crmHelper.IsTaskNeedUpdate(outlookTask);
            string result           = string.Empty;

            if (isTaskNeedupdate)
            {
                result = crmHelper.UpdateCrmTask(outlookTask);
            }
            return(result);
        }
        public string CreateAppointmentInCrm(Outlook outlookId)
        {
            Trace.TraceInformation("CreateAppointmentInCrm");

            if (!InitializeHelpers())
            {
                return("Initialize helpers fail");
            }
            if (crmHelper.GetCrmIdByOutlookId(new AppointmentEntity {
                OutlookId = outlookId.outlookId
            }) != Guid.Empty)
            {
                Trace.TraceInformation("CreateAppointmentInCrm: appointmtnt exist");

                return("Appointment is exist");
            }
            AppointmentEntity outlookAppointment = exchangeHelper.GetAppointmentFromOutlook(outlookId.outlookId);
            Guid result = crmHelper.CreateCrmAppointment(outlookAppointment);

            return(result.ToString());
        }