Example #1
0
        /// <summary>
        /// Filters the source by the specified search text.
        /// </summary>
        /// <param name="source">The songs to search.</param>
        /// <param name="searchText">The search text.</param>
        /// <returns>The filtered sequence of songs.</returns>
        public static MutableObservableCollection <TransactionStock> Filter(MutableObservableCollection <TransactionStock> source, string searchText)
        {
            if (String.IsNullOrWhiteSpace(searchText))
            {
                return(source);
            }

            IEnumerable <string> keyWords = searchText.Split(' ');

            return(source
                   .AsParallel()
                   .Where
                   (
                       item => keyWords.All
                       (
                           keyword =>
                           item.MaterialName.ContainsIgnoreCase(keyword) ||
                           item.QualityName.ContainsIgnoreCase(keyword) ||
                           item.SupplierName.ContainsIgnoreCase(keyword) ||
                           item.Qty.LessThanOrEqual(keyword) ||
                           item.CreatedDate.ToString("dd-MMM-YYYY").ContainsIgnoreCase(keyword)
                       )
                   )
                   .Convert <TransactionStock>());
        }
Example #2
0
        /// <summary>
        /// Filters the source by the specified search text.
        /// </summary>
        /// <param name="source">The songs to search.</param>
        /// <param name="searchText">The search text.</param>
        /// <returns>The filtered sequence of songs.</returns>
        public static MutableObservableCollection <CreateOrderModel> Filter(MutableObservableCollection <CreateOrderModel> source, string searchText)
        {
            if (String.IsNullOrWhiteSpace(searchText))
            {
                return(source);
            }

            IEnumerable <string> keyWords = searchText.Split(' ');

            return(source
                   .AsParallel()
                   .Where
                   (
                       item => keyWords.All
                       (
                           keyword =>
                           item.PoNumber.ContainsIgnoreCase(keyword) ||
                           item.CustomerName.ContainsIgnoreCase(keyword) ||
                           item.CustomerPhone.ContainsIgnoreCase(keyword) ||
                           item.TotalPayment.LessThanOrEqual(keyword) ||
                           item.CreatedDate.ToString("dd-MMM-YYYY").ContainsIgnoreCase(keyword) ||
                           item.Details.Source.Any(detail =>
                                                   (
                                                       detail.Title.ContainsIgnoreCase(keyword) ||
                                                       detail.SelectedMaterial.ContainsIgnoreCase(keyword) ||
                                                       detail.SelectedFinishing.ContainsIgnoreCase(keyword) ||
                                                       detail.SelectedQuality.ContainsIgnoreCase(keyword) ||
                                                       detail.Deadline.ToString() == (keyword)
                                                   )
                                                   )

                       )
                   )
                   .Convert <CreateOrderModel>());
        }
Example #3
0
        /// <summary>
        /// Filters the source by the specified search text.
        /// </summary>
        /// <param name="source">The songs to search.</param>
        /// <param name="searchText">The search text.</param>
        /// <returns>The filtered sequence of songs.</returns>
        public static MutableObservableCollection<CreateOrderModel> Filter(MutableObservableCollection<CreateOrderModel> source, string searchText)  
        {
            if (String.IsNullOrWhiteSpace(searchText))
                return source;

            IEnumerable<string> keyWords = searchText.Split(' ');

            return source
                .AsParallel()
                .Where
                (
                    item => keyWords.All
                    (
                        keyword =>
                            item.PoNumber.ContainsIgnoreCase(keyword) ||
                            item.CustomerName.ContainsIgnoreCase(keyword) ||
                            item.CustomerPhone.ContainsIgnoreCase(keyword) ||
                            item.TotalPayment.LessThanOrEqual(keyword) ||
                            item.CreatedDate.ToString("dd-MMM-YYYY").ContainsIgnoreCase(keyword) ||
                            item.Details.Source.Any(detail => 
                                (
                                    detail.Title.ContainsIgnoreCase(keyword) ||
                                    detail.SelectedMaterial.ContainsIgnoreCase(keyword) ||
                                    detail.SelectedFinishing.ContainsIgnoreCase(keyword) ||
                                    detail.SelectedQuality.ContainsIgnoreCase(keyword) ||
                                    detail.Deadline.ToString() == (keyword)
                                )
                            )
                            
                    )
                )
                .Convert<CreateOrderModel>();
        }
Example #4
0
        /// <summary>
        /// Filters the source by the specified search text.
        /// </summary>
        /// <param name="source">The songs to search.</param>
        /// <param name="searchText">The search text.</param>
        /// <returns>The filtered sequence of songs.</returns>
        public static MutableObservableCollection<TransactionStock> Filter(MutableObservableCollection<TransactionStock> source, string searchText)
        {
            if (String.IsNullOrWhiteSpace(searchText))
                return source;

            IEnumerable<string> keyWords = searchText.Split(' ');

            return source
                .AsParallel()
                .Where
                (
                    item => keyWords.All
                    (
                        keyword =>
                            item.MaterialName.ContainsIgnoreCase(keyword) ||
                            item.QualityName.ContainsIgnoreCase(keyword) ||
                            item.SupplierName.ContainsIgnoreCase(keyword) ||
                            item.Qty.LessThanOrEqual(keyword) ||
                            item.CreatedDate.ToString("dd-MMM-YYYY").ContainsIgnoreCase(keyword)   
                    )
                )
                .Convert<TransactionStock>();
        }