Esempio n. 1
0
        /// <summary>
        /// Maps a <see cref='Altask.Data.Model.AssetLogType'/> object to a <see cref='Altask.Data.Dto.AssetLogType'/> object.
        /// </summary>
        public static Altask.Data.Dto.AssetLogType ToDto(this Altask.Data.Model.AssetLogType entity)
        {
            var dto = new Altask.Data.Dto.AssetLogType();

            dto.Id = entity.Id;
            dto.AssetLogTypeCategoryId = entity.AssetLogTypeCategoryId;
            dto.Active      = entity.Active;
            dto.CanComment  = entity.CanComment;
            dto.CanResolve  = entity.CanResolve;
            dto.Name        = entity.Name;
            dto.Description = entity.Description;
            dto.Value       = entity.Value;
            dto.System      = entity.System;

            if (entity.Category != null)
            {
                dto.Category = entity.Category.ToDto();
            }

            dto.Assets = new List <Altask.Data.Dto.AssetLogTypeAsset>();

            if (entity.Assets != null)
            {
                foreach (var item in entity.Assets)
                {
                    dto.Assets.Add(item.ToDto());
                }
            }

            return(dto);
        }
Esempio n. 2
0
        internal static void NotifyAssetLogTypeUpdate(Guid?clientId, Altask.Data.Dto.AssetLogType assetLogType)
        {
            if (!clientId.HasValue)
            {
                _context.Clients.All.notifyAssetLogTypeUpdate(new { assetLogType = assetLogType });
            }
            else
            {
                SignalRConnection connection;

                if (_connections.TryGetValue(clientId.Value, out connection))
                {
                    _context.Clients.AllExcept(connection.ConnectionId).notifyAssetLogTypeUpdate(new { connection = connection, assetLogType = assetLogType });
                }
                else
                {
                    _context.Clients.All.notifyAssetLogTypeCreate(new { assetLogType = assetLogType });
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Maps all the non-primary key and tracking properties of a <see cref='Altask.Data.Dto.AssetLogType'/> object to a <see cref='Altask.Data.Model.AssetLogType'/> object.
 /// </summary>
 public static Altask.Data.Model.AssetLogType FromDto(this Altask.Data.Model.AssetLogType model, Altask.Data.Dto.AssetLogType entity)
 {
     model.AssetLogTypeCategoryId = entity.AssetLogTypeCategoryId;
     model.Active      = entity.Active;
     model.CanComment  = entity.CanComment;
     model.CanResolve  = entity.CanResolve;
     model.Name        = entity.Name;
     model.Description = entity.Description;
     model.Value       = entity.Value;
     model.System      = entity.System;
     return(model);
 }