コード例 #1
0
ファイル: NomenclatureModule.cs プロジェクト: war-man/Railway
        public bool UpdateRelatingFilters(ScrollLineDTO scroll, ref IList <CheckListFilter> filters, EnumTypeFilterMenu typeFilter)
        {
            if (scroll == null)
            {
                return(false);
            }

            //build lambda expression basic on active filter(linqKit)
            var finalPredicate = filters.Where(x => x.ActiveFilter).Aggregate(
                PredicateBuilder.New <krt_Naftan_orc_sapod>().And(x => x.keykrt == scroll.KEYKRT),
                (current, innerItemMode) => current.And(innerItemMode.FilterByField <krt_Naftan_orc_sapod>())
                );

            foreach (var item in filters)
            {
                item.CheckedValues = this._engage.GetGroup(PredicateExtensions.GroupPredicate <krt_Naftan_orc_sapod>(item.FieldName).Expand(), finalPredicate.Expand()).Select(x => x.ToString());
            }

            return(true);
        }