Ejemplo n.º 1
0
        public void LogResult(PXSyncResult result)
        {
            string action = null;

            if (!String.IsNullOrEmpty(result.ActionTitle))
            {
                action = result.ActionTitle;
            }
            else if (result.ItemStatus != PXSyncItemStatus.None)
            {
                action = result.ItemStatus.ToString( );
            }
            else
            {
                action = "Processing";
            }

            if (result.Success)
            {
                string text = PXMessages.LocalizeFormatNoPrefix(Messages.EmailExchangeSyncSuccessful, result.Direction.ToString(), result.OperationTitle, result.Address, result.DisplayKey, action);
                LogEvent(new PXExchangeEvent(result.Address, EventLevel.Informational, text, result.Error)
                {
                    Date = result.Date
                });
            }
            else
            {
                string text = PXMessages.LocalizeFormatNoPrefix(Messages.EmailExchangeSyncError, result.Direction.ToString(), result.OperationTitle, result.Address, result.DisplayKey, action);
                text = CreateErrorMessage(true, text, result.Message, result.Error, result.Details);
                LogEvent(new PXExchangeEvent(result.Address, EventLevel.Error, text, result.Error)
                {
                    Date = result.Date
                });
            }
        }
Ejemplo n.º 2
0
        public PXSyncResult(PXSyncResult result, string id = null, Guid?note = null, string key = null, PXSyncItemStatus?status = null)
            : this(result.OperationTitle, result.Direction, result.Address, id ?? result.ItemID, note ?? result.NoteID, key ?? result.DisplayKey)
        {
            ItemStatus     = result.ItemStatus;
            DisplayKey     = result.DisplayKey;
            ActionTitle    = result.ActionTitle;
            OperationTitle = result.OperationTitle;
            Direction      = result.Direction;

            Error   = result.Error;
            Message = result.Message;
            Details = result.Details;

            Date      = result.Date;
            Reprocess = result.Reprocess;
        }