Пример #1
0
 public PublishedProcessFilterSource(PublishedProcessWithFiltersInfo process)
 {
     _process = process;
 }
        /// <summary>
        /// Setups the filters.
        /// </summary>
        /// <param name="selectedProcessFitlersInfo">The selected process fitlers information.</param>
        private void SetupFilters(PublishedProcessWithFiltersInfo selectedProcessFitlersInfo)
        {
            _selectedProcessFitlersInfo = selectedProcessFitlersInfo;

            _isLoading = true;
            Filters.Clear();

            Filters.Add(new Filter(Constants.FilterMissing, Guid.Empty, string.Empty));

            if (selectedProcessFitlersInfo != null && selectedProcessFitlersInfo.Filters != null)
            {
                foreach (var filter in selectedProcessFitlersInfo.Filters)
                {
                    Filters.Add(filter.ToFilter());
                }
            }

            var config = _configurator.ParseConfig(_processViewField.CustomConfig);
            if (config != null)
            {
                FilterGuid = config.FilterGuid ?? Guid.Empty;
                FilterDefinition = config.FilterDefinition;
            }

            SelectedFilter = Guid.Empty != FilterGuid ? Filters.FirstOrDefault(f => f.FilterGuid == FilterGuid) : Filters[0];

            _isLoading = false;
            IsProcessSelected = true;
        }
Пример #3
0
        private static async void LoadFilterAdditionalParameters(FilterDescriptorDecorator filterDescriptor, PublishedProcessWithFiltersInfo process)
        {
            try
            {
                if (string.IsNullOrEmpty(filterDescriptor.ColumnName))
                {
                    return;
                }

                var filterFormat = new FilterFormatType { MemberType = filterDescriptor.MemberType };

                if (filterDescriptor.ColumnName == Constants.CurrentStateIdColumnName)
                {
                    if (process.IsStateEnabled)
                    {
                        filterDescriptor.FilterFormatMemberType = filterFormat;
                        filterDescriptor.FilteringProcessSystemName = process.SystemName;
                        filterDescriptor.CrossRefDisplayFieldsList = Constants.Name;
                        filterDescriptor.CrossRefFieldName = Constants.CurrentStateColumnName;
                        filterDescriptor.CrossRefProcessName = Constants.StateProcessName;
                    }

                    return;
                }

                var fieldInfo = await MemberInfoRetriever.GetMemberInfoAsync(process.Id, filterDescriptor.ColumnName);
                if (fieldInfo == null)
                {
                    return;
                }

                if (fieldInfo.ColumnType == ColumnTypes.DateTime && fieldInfo.DateTimeFormat != null)
                {
                    filterFormat.FormatType = fieldInfo.DateTimeFormat.ToString();
                }

                filterDescriptor.FilteringProcessSystemName = fieldInfo.DefinedIn;
                filterDescriptor.FilterFormatMemberType = filterFormat;

                if (!string.IsNullOrEmpty(fieldInfo.ReferencedProcessSystemName))
                {
                    filterDescriptor.CrossRefDisplayFieldsList = fieldInfo.ReferencedFieldSystemName;
                    filterDescriptor.CrossRefFieldName = fieldInfo.SystemName;
                    filterDescriptor.CrossRefProcessName = fieldInfo.ReferencedProcessSystemName;
                }
            }
            catch (DataPortalException)
            {
            }
        }
Пример #4
0
        /// <summary>
        /// Setups the filters.
        /// </summary>
        /// <param name="selectedProcessFitlersInfo">The selected process fitlers information.</param>
        protected void SetupFilters(PublishedProcessWithFiltersInfo selectedProcessFitlersInfo)
        {
            _selectedProcessFitlersInfo = selectedProcessFitlersInfo;

            _isLoading = true;
            _isUpdatingFilters = true;
            Filters.Clear();

            Filters.Add(new Filter(Constants.FilterMissing, Guid.Empty, string.Empty));

            if (selectedProcessFitlersInfo != null && selectedProcessFitlersInfo.Filters != null)
            {
                foreach (var filter in selectedProcessFitlersInfo.Filters)
                {
                    Filters.Add(filter.ToFilter());
                }
            }

            SelectedFilter = Guid.Empty != FilterGuid ? Filters.FirstOrDefault(f => f.FilterGuid == FilterGuid) : Filters[0];

            _isLoading = false;
            _isUpdatingFilters = false;
            IsProcessSelected = true;
        }
Пример #5
0
        /// <summary>
        /// Loads the filter additional parameters.
        /// </summary>
        /// <param name="filters">The filters.</param>
        /// <param name="processInfo">The process information.</param>
        public static void LoadFilterAdditionalParameters(IEnumerable<FilterDescriptorDecorator> filters, PublishedProcessWithFiltersInfo processInfo)
        {
            if (processInfo == null || filters == null)
                return;

            foreach (var filterDescriptor in filters)
            {
                LoadFilterAdditionalParameters(filterDescriptor, processInfo);
            }
        }