Esempio n. 1
0
        public string UpdateTaskInOutlook(TaskEntity taskEntity)
        {
            Trace.TraceInformation("Update task in outlook");

            if (!InitializeHelpers())
            {
                return("Initialize helpers fail");
            }
            string outlookTaskId = crmHelper.GetOutlookId(taskEntity);

            if (taskEntity.NewTaskOwnerId == Guid.Empty)
            {
                taskEntity.OutlookId = outlookTaskId;
                exchangeHelper.UpdateOutlookTask(taskEntity);
                //if(crmHelper.IsTaskNeedUpdate(taskEntity))
                //crmHelper.UpdateCrmTask(taskEntity);
            }
            else
            {
                string newOwnerMail          = crmHelper.GetUserMailByGuid(taskEntity.NewTaskOwnerId);
                string newOutlookTaskId      = exchangeHelper.CreateNewOutlookTask(taskEntity, newOwnerMail);
                string oldOutlookIdForDelete = outlookTaskId;
                taskEntity.OutlookId = newOutlookTaskId;
                //if(crmHelper.IsTaskNeedUpdate(taskEntity))
                //crmHelper.UpdateCrmTask(taskEntity);
                exchangeHelper.DeleteOutlookTaskById(oldOutlookIdForDelete);
            }
            return("Update success");
        }
        public string UpdateAppointmentInOutlook(AppointmentEntity appointmentEntity)
        {
            Trace.TraceInformation("UpdateAppointmentInOutlook");

            if (!InitializeHelpers())
            {
                return("Initialize helpers fail");
            }
            appointmentEntity.OutlookId = crmHelper.GetOutlookId(appointmentEntity);
            exchangeHelper.UpdateOutlookAppointment(appointmentEntity);
            //crmHelper.UpdateCrmAppointment(appointmentEntity);
            return("Update appointment success");
        }