public void ExportMessageToCrm(int id_message, IEnumerable <CrmContactEntity> crm_contact_ids) { try { if (id_message < 0) { throw new ArgumentException("Invalid message id", "id_message"); } if (crm_contact_ids == null) { throw new ArgumentException("Invalid contact ids list", "crm_contact_ids"); } var message_item = mailBoxManager.GetMailInfo(TenantId, Username, id_message, true, true); message_item.LinkedCrmEntityIds = crm_contact_ids.ToList(); var crm_dal = new ASC.Mail.Aggregator.Dal.CrmHistoryDal(mailBoxManager, TenantId, Username); crm_dal.AddRelationshipEvents(message_item); } catch (Exception) { mailBoxManager.CreateCrmOperationFailureAlert(TenantId, Username, id_message, MailBoxManager.AlertTypes.ExportFailure); } }
public void ExportMessageToCrm(int id_message, IEnumerable <CrmContactEntity> crm_contact_ids) { try { if (id_message < 0) { throw new ArgumentException(@"Invalid message id", "id_message"); } if (crm_contact_ids == null) { throw new ArgumentException(@"Invalid contact ids list", "crm_contact_ids"); } var messageItem = MailBoxManager.GetMailInfo(TenantId, Username, id_message, true, true); messageItem.LinkedCrmEntityIds = crm_contact_ids.ToList(); var crmDal = new ASC.Mail.Aggregator.Dal.CrmHistoryDal(TenantId, Username); crmDal.AddRelationshipEvents(messageItem); } catch (Exception ex) { MailBoxManager.CreateCrmOperationFailureAlert(TenantId, Username, id_message, MailBoxManager.AlertTypes.ExportFailure); Logger.Error(ex, "Issue with exort to crm message_id: {0}, crm_contacts_id {1}", new object[] { id_message, crm_contact_ids }); } }
public void ExportMessageToCrm(int id_message, IEnumerable<CrmContactEntity> crm_contact_ids) { try { if (id_message < 0) throw new ArgumentException(@"Invalid message id", "id_message"); if (crm_contact_ids == null) throw new ArgumentException(@"Invalid contact ids list", "crm_contact_ids"); var messageItem = MailBoxManager.GetMailInfo(TenantId, Username, id_message, true, true); messageItem.LinkedCrmEntityIds = crm_contact_ids.ToList(); var crmDal = new ASC.Mail.Aggregator.Dal.CrmHistoryDal(TenantId, Username); crmDal.AddRelationshipEvents(messageItem); } catch (Exception ex) { MailBoxManager.CreateCrmOperationFailureAlert(TenantId, Username, id_message, MailBoxManager.AlertTypes.ExportFailure); Logger.Error(ex, "Issue with exort to crm message_id: {0}, crm_contacts_id {1}", new object[]{id_message, crm_contact_ids}); } }
public void ExportMessageToCrm(int id_message, IEnumerable<CrmContactEntity> crm_contact_ids) { try { if (id_message < 0) throw new ArgumentException("Invalid message id", "id_message"); if (crm_contact_ids == null) throw new ArgumentException("Invalid contact ids list", "crm_contact_ids"); var message_item = mailBoxManager.GetMailInfo(TenantId, Username, id_message, true, true); message_item.LinkedCrmEntityIds = crm_contact_ids.ToList(); var crm_dal = new ASC.Mail.Aggregator.Dal.CrmHistoryDal(mailBoxManager, TenantId, Username); crm_dal.AddRelationshipEvents(message_item); } catch (Exception) { mailBoxManager.CreateCrmOperationFailureAlert(TenantId, Username, id_message, MailBoxManager.AlertTypes.ExportFailure); } }