コード例 #1
0
        internal Control_DocumentWorkflow(DBInternPage DBInternPage)
        {
            InitializeComponent();

            documentWorkflowUserService        = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDocumentWorkflowUserService>();
            documentWorkflowAppSettingsService = CommonServiceLocator.ServiceLocator.Current.GetInstance <IDocumentWorkflowAppSettingsService>();
            fileStructureService        = CommonServiceLocator.ServiceLocator.Current.GetInstance <IFileStructureService>();
            sessionService              = CommonServiceLocator.ServiceLocator.Current.GetInstance <ISessionService>();
            documentWorkflowAppSettings = documentWorkflowAppSettingsService.Get(DBInternPage.Guid);

            if (documentWorkflowAppSettings == null || string.IsNullOrWhiteSpace(documentWorkflowAppSettings.InternalName))
            {
                MessageBox.Show("Konfiguration nicht vorhanden", "...");
                return;
            }

            PageName = documentWorkflowAppSettings.PublicName;

            documentWorkflowUser = documentWorkflowUserService.Get(sessionService.CurrentSession.UserId);

            if (documentWorkflowUser == null)
            {
                documentWorkflowUser = new DocumentWorkflowUser
                {
                    UserId    = sessionService.CurrentSession.UserId,
                    IsDeleted = false
                                // TODO: Set current tenant
                };

                documentWorkflowUserService.Save(documentWorkflowUser);
            }

            fileStructureConfiguration = fileStructureService.GetByInstanceDataGuid(documentWorkflowUser.Guid);
            if (fileStructureConfiguration == null)
            {
                fileStructureConfiguration = new FileStructure
                {
                    IsTemplate       = false,
                    InstanceDataGuid = documentWorkflowUser.Guid,
                    Id        = Guid.NewGuid(),
                    Name      = documentWorkflowAppSettings.PublicName,
                    StackGuid = stackGuid
                };

                fileStructureService.Save(fileStructureConfiguration);
            }

            fileStructureConfiguration.Name = $"{documentWorkflowAppSettings.PublicName}({Framework.Base.UserManager.Singleton.GetFriendlyName(sessionService.CurrentSession.UserId)})";

            fileStructureControl.Initialize(fileStructureConfiguration);

            Loaded += ControlLoaded;
        }
コード例 #2
0
 /// <summary>
 /// Constructor for dependency injection.
 /// </summary>
 /// <param name="fileStructureService"></param>
 /// <param name="documentWorkflowAppSettingsService"></param>
 /// <param name="documentWorkflowUserService"></param>
 /// <param name="fileStructureDocumentPathService"></param>
 /// <param name="documentWorkflowTrackerService"></param>
 /// <param name="documentWorkflowOrganizationUnitAssignmentService"></param>
 public WorkflowOperationService(IFileStructureService fileStructureService,
                                 IDocumentWorkflowAppSettingsService documentWorkflowAppSettingsService,
                                 IDocumentWorkflowUserService documentWorkflowUserService,
                                 IFileStructureDocumentPathService fileStructureDocumentPathService,
                                 IDocumentWorkflowTrackerService documentWorkflowTrackerService,
                                 IDocumentWorkflowOrganizationUnitAssignmentService documentWorkflowOrganizationUnitAssignmentService,
                                 IDocumentWorkflowConfigurationService documentWorkflowConfigurationService,
                                 IUnityContainer unityContainer,
                                 IDocumentWorkflowAssignmentService documentWorkflowAssignmentService,
                                 Flow.Event.IFlowEventService flowEventService)
 {
     this.fileStructureService = fileStructureService;
     this.documentWorkflowAppSettingsService = documentWorkflowAppSettingsService;
     this.documentWorkflowUserService        = documentWorkflowUserService;
     this.fileStructureDocumentPathService   = fileStructureDocumentPathService;
     this.documentWorkflowTrackerService     = documentWorkflowTrackerService;
     this.documentWorkflowOrganizationUnitAssignmentService = documentWorkflowOrganizationUnitAssignmentService;
     this.unityContainer = unityContainer;
     this.documentWorkflowConfigurationService = documentWorkflowConfigurationService;
     this.documentWorkflowAssignmentService    = documentWorkflowAssignmentService;
     this.flowEventService = flowEventService;
 }
コード例 #3
0
 public Window_DocumentWorkflowAppSettings(IDocumentWorkflowAppSettingsService service) : base(service)
 {
     InitializeComponent();
     this.service = service;
 }