Esempio n. 1
0
        public DataTransfer.Models.TaskGraph Add(DataTransfer.Events.TaskGraph item)
        {
            var mappedItem = new DataTransfer.Models.TaskGraph
            {
                Id          = item.Id,
                Description = item.Description,
                Name        = item.Name,
                RootId      = null,
                UserId      = item.UserId,
                TaskSetId   = null
            };

            var added = dataCollector.Add(mappedItem);

            var ws = ServiceFactory.WorkspaceService.Get(item.WorkspaceId);

            if (ws.TaskGraphIds == null)
            {
                ws.TaskGraphIds = new List <Guid>();
            }
            ws.TaskGraphIds.Add(added.Id);

            DataCollectorFactory.workspaceCollector.Update(ws);

            return(added);
        }
Esempio n. 2
0
        public DataTransfer.Models.TaskGraph Update(DataTransfer.Events.TaskGraph item)
        {
            var mappedItem = new DataTransfer.Models.TaskGraph
            {
                Id          = item.Id,
                Description = item.Description,
                Name        = item.Name,
                RootId      = item.RootId
            };

            return(dataCollector.Update(mappedItem));
        }