Esempio n. 1
0
        public static void MergeReferentials(this IReferentialsService service, IActionReferential master, IActionReferential[] slaves)
        {
            var operation = new AsyncServiceOperation();

            service.MergeReferentials(master, slaves, operation.OnDone, operation.OnError);

            operation.WaitCompletion();
        }
Esempio n. 2
0
        public static void SaveReferentials <TReferential>(this IReferentialsService service, IEnumerable <TReferential> referentials)
            where TReferential : class, IObjectWithChangeTracker
        {
            var operation = new AsyncServiceOperation();

            service.SaveReferentials(referentials, operation.OnDone, operation.OnError);

            operation.WaitCompletion();
        }
Esempio n. 3
0
 public ActionController(IPrepareService prepareService,
                         IApplicationUsersService applicationUsersService,
                         IReferentialsService referentialsService,
                         ILocalizationManager localizationManager
                         )
     : base(localizationManager)
 {
     _prepareService          = prepareService;
     _applicationUsersService = applicationUsersService;
     _referentialsService     = referentialsService;
 }
Esempio n. 4
0
 public QualificationController(
     IApplicationUsersService applicationUsersService,
     IPrepareService prepareService,
     IReferentialsService referentialsService,
     ITraceManager traceManager,
     ILocalizationManager localizationManager
     )
     : base(localizationManager)
 {
     _applicationUsersService = applicationUsersService;
     _prepareService          = prepareService;
     _referentialsService     = referentialsService;
     _traceManager            = traceManager;
 }
Esempio n. 5
0
        /// <summary>
        /// Retrieve all the headers that needs to be displayed in the grid
        /// </summary>
        /// <param name="project"></param>
        /// <param name="serviceReferentials"></param>
        /// <param name="includeOnlyReferentialsAndCustom"></param>
        /// <returns></returns>
        public static async Task <Dictionary <string, string> > GetHeaders(
            int processId,
            IReferentialsService referentialsService,
            bool includeOnlyReferentialsAndCustom = false)
        {
            var LocalizedStrings = DependencyResolver.Current.GetService <ILocalizationManager>();

            var documentationReferentials = await referentialsService.GetDocumentationReferentials(processId);

            var headers = !includeOnlyReferentialsAndCustom ? new Dictionary <string, string>
            {
                [nameof(PublishedAction.WBS)]               = "Id",
                [nameof(PublishedAction.Label)]             = LocalizedStrings.GetString("Grid_LabelHeaderText"),
                [nameof(PublishedAction.Thumbnail)]         = LocalizedStrings.GetString("Grid_ThumbnailHeaderText"),
                [nameof(PublishedAction.Duration)]          = LocalizedStrings.GetString("Grid_DurationHeaderText"),
                [nameof(PublishedAction.PublishedResource)] = LocalizedStrings.GetString("Grid_PublishedResourceHeaderText")
            } : new Dictionary <string, string>();

            foreach (var docRef in documentationReferentials.Where(_ => _.IsEnabled))
            {
                switch (docRef.ReferentialId)
                {
                case ProcessReferentialIdentifier.Category:
                    headers.Add(nameof(PublishedAction.PublishedActionCategory),
                                docRef.Label);
                    break;

                case ProcessReferentialIdentifier.Skill:
                    headers.Add(docRef.ReferentialId.ToString(),
                                docRef.Label);
                    break;

                case ProcessReferentialIdentifier.Ref1:
                case ProcessReferentialIdentifier.Ref2:
                case ProcessReferentialIdentifier.Ref3:
                case ProcessReferentialIdentifier.Ref4:
                case ProcessReferentialIdentifier.Ref5:
                case ProcessReferentialIdentifier.Ref6:
                case ProcessReferentialIdentifier.Ref7:
                    headers.Add(docRef.ReferentialId.ToString().Insert(3, "s"),
                                docRef.Label);
                    break;

                case ProcessReferentialIdentifier.CustomTextLabel:
                    headers.Add(nameof(PublishedAction.CustomTextValue), docRef.Label);
                    break;

                case ProcessReferentialIdentifier.CustomTextLabel2:
                    headers.Add(nameof(PublishedAction.CustomTextValue2), docRef.Label);
                    break;

                case ProcessReferentialIdentifier.CustomTextLabel3:
                    headers.Add(nameof(PublishedAction.CustomTextValue3), docRef.Label);
                    break;

                case ProcessReferentialIdentifier.CustomTextLabel4:
                    headers.Add(nameof(PublishedAction.CustomTextValue4), docRef.Label);
                    break;

                case ProcessReferentialIdentifier.CustomNumericLabel:
                    headers.Add(nameof(PublishedAction.CustomNumericValue), docRef.Label);
                    break;

                case ProcessReferentialIdentifier.CustomNumericLabel2:
                    headers.Add(nameof(PublishedAction.CustomNumericValue2), docRef.Label);
                    break;

                case ProcessReferentialIdentifier.CustomNumericLabel3:
                    headers.Add(nameof(PublishedAction.CustomNumericValue3), docRef.Label);
                    break;

                case ProcessReferentialIdentifier.CustomNumericLabel4:
                    headers.Add(nameof(PublishedAction.CustomNumericValue4), docRef.Label);
                    break;
                }
            }

            return(headers);
        }
Esempio n. 6
0
 /// <summary>
 /// ReferentialServiceController ctors
 /// </summary>
 /// <param name="referentialService"></param>
 /// <param name="securityContext"></param>
 public ReferentialsServiceController(ITraceManager traceManager, IReferentialsService referentialService, ISecurityContext securityContext)
 {
     _traceManager       = traceManager;
     _referentialService = referentialService;
     _securityContext    = securityContext;
 }