public void AddEntities(SyncMessageStatus status, IList <string> entities, string message)
 {
     Write("Add entities, count={0}, syncType={1}, message={2}",
           entities.Count.ToString(),
           status.ToString(),
           message);
 }
Esempio n. 2
0
        public void AddEntities(SyncMessageStatus status, IList <string> entities, string message)
        {
            foreach (var entity in entities)
            {
                TryAddToList(_orderList, entity);
                switch (status)
                {
                case SyncMessageStatus.Error:
                    TryAddToList(_withErrors, entity);
                    break;

                case SyncMessageStatus.Warning:
                    TryAddToList(_withWarning, entity);
                    break;
                }
            }

            AddMessage("", message + " - count=" + entities.Count, status);
        }
Esempio n. 3
0
        private void AddMessage(string entityId, string message, SyncMessageStatus status)
        {
            if (_syncHistoryId.HasValue)
            {
                using (var db = _dbFactory.GetRWDb())
                {
                    var dbMessage = new SyncMessage
                    {
                        SyncHistoryId = _syncHistoryId.Value,
                        EntityId      = entityId,

                        Message = StringHelper.Substring(message, 1024),
                        Status  = (int)status,

                        CreateDate = DateTime.UtcNow
                    };

                    db.SyncMessages.Add(dbMessage);
                    db.Commit();
                }
                _logger.Info("[Sync] message=" + message + ", status=" + status);
            }
        }