Пример #1
0
 public void GoodSearch(object obj = null) => Task.Factory.StartNew(() =>
 {
     GoodsList = fullGoodsList;
     if (!String.IsNullOrEmpty(GoodSearchText))
     {
         var searchList = GoodSearchText.Split(' ');
         if (searchList.Count() > 0)
         {
             foreach (var item in searchList)
             {
                 if (!String.IsNullOrEmpty(item))
                 {
                     var text  = item?.ToUpper()?.Trim(' ') ?? "";
                     GoodsList = GoodsList.Where(
                         x => (x.Name?.ToUpper().Trim(' ').Contains(text) ?? false) ||
                         (x.Id?.ToUpper().Trim(' ').Contains(text) ?? false) ||
                         (x.Manufacturer?.ToUpper().Trim(' ').Contains(text) ?? false) ||
                         (x.Code?.ToUpper().Trim(' ').Contains(text) ?? false) ||
                         (x.BarCode?.ToUpper().Trim(' ').Contains(text) ?? false)
                         ).ToList();
                 }
             }
         }
     }
 });