public List <KnowledgeGroupRecord> UpdateKnowledgeGroups(
            IList <KnowledgeGroupRecord> importKnowledgeGroups,
            IKnowledgeGroupService service,
            ref int modifiedRecords
            )
        {
            var knowledgeGroupRecords = service.FindAllAsync().Result;

            var patch = new PatchDefinition <KnowledgeGroupRecord, KnowledgeGroupRecord>(
                (source, list) => list.SingleOrDefault(a => a.Id == source.Id)
                );

            patch
            .Map(s => s.Id, t => t.Id)
            .Map(s => s.Name, t => t.Name)
            .Map(s => s.Description, t => t.Description)
            .Map(s => s.FontAwesomeIconCharacterUnicodeAddress, t => t.FontAwesomeIconCharacterUnicodeAddress)
            .Map(s => s.Order, t => t.Order);

            var diff = patch.Patch(importKnowledgeGroups, knowledgeGroupRecords);

            service.ApplyPatchOperationAsync(diff).Wait();

            modifiedRecords += diff.Count(a => a.Action != ActionEnum.NotModified);
            return(diff.Where(a => a.Entity.IsDeleted == 0).Select(a => a.Entity).ToList());
        }
Exemplo n.º 2
0
 public SyncController(
     ILoggerFactory loggerFactory,
     IEventService eventService,
     IEventConferenceDayService eventConferenceDayService,
     IEventConferenceRoomService eventConferenceRoomService,
     IEventConferenceTrackService eventConferenceTrackService,
     IKnowledgeGroupService knowledgeGroupService,
     IKnowledgeEntryService knowledgeEntryService,
     IImageService imageService,
     IDealerService dealerService,
     IAnnouncementService announcementService,
     IMapService mapService
     )
 {
     _logger = loggerFactory.CreateLogger(GetType());
     _eventConferenceTrackService = eventConferenceTrackService;
     _eventConferenceRoomService  = eventConferenceRoomService;
     _eventConferenceDayService   = eventConferenceDayService;
     _eventService          = eventService;
     _knowledgeGroupService = knowledgeGroupService;
     _knowledgeEntryService = knowledgeEntryService;
     _imageService          = imageService;
     _dealerService         = dealerService;
     _announcementService   = announcementService;
     _mapService            = mapService;
 }
Exemplo n.º 3
0
 public RoleController(
     IAppUserService AppUserService,
     IMenuService MenuService,
     IRoleService RoleService,
     IPermissionService PermissionService,
     IOrganizationService OrganizationService,
     IProductService ProductService,
     IFieldService FieldService,
     IPermissionOperatorService PermissionOperatorService,
     IRequestStateService RequestStateService,
     IStatusService StatusService,
     ICustomerGroupingService CustomerGroupingService,
     IKnowledgeGroupService KnowledgeGroupService,
     ICurrentContext CurrentContext
     , IHttpContextAccessor httpContextAccessor, DataContext _DataContext
     ) : base(httpContextAccessor, _DataContext)
 {
     this.AppUserService            = AppUserService;
     this.MenuService               = MenuService;
     this.RoleService               = RoleService;
     this.PermissionService         = PermissionService;
     this.OrganizationService       = OrganizationService;
     this.ProductService            = ProductService;
     this.FieldService              = FieldService;
     this.StatusService             = StatusService;
     this.PermissionOperatorService = PermissionOperatorService;
     this.RequestStateService       = RequestStateService;
     this.CustomerGroupingService   = CustomerGroupingService;
     this.KnowledgeGroupService     = KnowledgeGroupService;
     this.CurrentContext            = CurrentContext;
 }
 public KnowledgeCommand(
     IKnowledgeEntryService knowledgeEntryService,
     IKnowledgeGroupService knowledgeGroupService,
     IImageService imageService)
 {
     _knowledgeEntryService = knowledgeEntryService;
     _knowledgeGroupService = knowledgeGroupService;
     _imageService          = imageService;
 }
Exemplo n.º 5
0
 public KnowledgeGroupController(
     IStatusService StatusService,
     IKnowledgeGroupService KnowledgeGroupService,
     ICurrentContext CurrentContext
     , IHttpContextAccessor httpContextAccessor, DataContext _DataContext
     ) : base(httpContextAccessor, _DataContext)
 {
     this.StatusService         = StatusService;
     this.KnowledgeGroupService = KnowledgeGroupService;
     this.CurrentContext        = CurrentContext;
 }
Exemplo n.º 6
0
 public SyncController(
     IEventService eventService,
     IEventConferenceDayService eventConferenceDayService,
     IEventConferenceRoomService eventConferenceRoomService,
     IEventConferenceTrackService eventConferenceTrackService,
     IKnowledgeGroupService knowledgeGroupService,
     IKnowledgeEntryService knowledgeEntryService
     )
 {
     _eventConferenceTrackService = eventConferenceTrackService;
     _eventConferenceRoomService  = eventConferenceRoomService;
     _eventConferenceDayService   = eventConferenceDayService;
     _eventService          = eventService;
     _knowledgeGroupService = knowledgeGroupService;
     _knowledgeEntryService = knowledgeEntryService;
 }
Exemplo n.º 7
0
 public KnowledgeArticleController(
     IAppUserService AppUserService,
     IKnowledgeGroupService KnowledgeGroupService,
     IStatusService StatusService,
     IKnowledgeArticleService KnowledgeArticleService,
     IOrganizationService OrganizationService,
     IItemService ItemService,
     IKMSStatusService KMSStatusService,
     ICurrentContext CurrentContext
     , IHttpContextAccessor httpContextAccessor, DataContext _DataContext
     ) : base(httpContextAccessor, _DataContext)
 {
     this.AppUserService          = AppUserService;
     this.KnowledgeGroupService   = KnowledgeGroupService;
     this.StatusService           = StatusService;
     this.KnowledgeArticleService = KnowledgeArticleService;
     this.OrganizationService     = OrganizationService;
     this.ItemService             = ItemService;
     this.KMSStatusService        = KMSStatusService;
     this.CurrentContext          = CurrentContext;
 }
        public static List <KnowledgeGroupRecord> UpdateKnowledgeGroups(
            IList <KnowledgeGroupRecord> importKnowledgeGroups,
            IKnowledgeGroupService service
            )
        {
            var knowledgeGroupRecords = service.FindAllAsync().Result;

            var patch = new PatchDefinition <KnowledgeGroupRecord, KnowledgeGroupRecord>(
                (source, list) => list.SingleOrDefault(a => a.Id == source.Id)
                );

            patch
            .Map(s => s.Id, t => t.Id)
            .Map(s => s.Name, t => t.Name)
            .Map(s => s.Description, t => t.Description)
            .Map(s => s.Order, t => t.Order);

            var diff = patch.Patch(importKnowledgeGroups, knowledgeGroupRecords);

            service.ApplyPatchOperationAsync(diff).Wait();

            return(diff.Where(a => a.Entity.IsDeleted == 0).Select(a => a.Entity).ToList());
        }
Exemplo n.º 9
0
 public KnowledgeGroupsController(IKnowledgeGroupService knowledgeGroupService)
 {
     _knowledgeGroupService = knowledgeGroupService;
 }
 public WikiFileImporter(IKnowledgeGroupService knowledgeGroupService, IKnowledgeEntryService knowledgeEntryService, IImageService imageService)
 {
     _knowledgeGroupService = knowledgeGroupService;
     _knowledgeEntryService = knowledgeEntryService;
     _imageService          = imageService;
 }