Exemple #1
0
        private IEnumerable <MeterReadingViewModel> SearchInReadingList()
        {
            if (string.IsNullOrEmpty(ReadingSearchText))
            {
                return(m_MeterReadings);
            }
            var searchText = ReadingSearchText.ToLower();

            //TODO: kein Name???
            var searchResult = m_MeterReadings.Where(r => (((r.MeterViewModel.Barcode != null) && (r.MeterViewModel.Barcode.ToLower()
                                                                                                   .Contains(searchText))) || ((r.MeterViewModel.Name != null) && (r.MeterViewModel.Name.ToLower()
                                                                                                                                                                   .Contains(searchText))) ||
                                                           ((r.AppointmentResponsibleSubject != null) && (r.AppointmentResponsibleSubject.IsOfType <Employee>()) &&
                                                            ((((Employee)r.AppointmentResponsibleSubject).FirstName != null) && ((Employee)r.AppointmentResponsibleSubject).FirstName.ToLower()
                                                             .Contains(searchText)) ||
                                                            ((((Employee)r.AppointmentResponsibleSubject).LastName != null) && ((Employee)r.AppointmentResponsibleSubject).LastName.ToLower()
                                                             .Contains(searchText)) ||
                                                            (((Employee)r.AppointmentResponsibleSubject).Number != null) && ((Employee)r.AppointmentResponsibleSubject).Number.ToLower()
                                                            .Contains(searchText))) ||
                                                     ((r.AppointmentResponsibleSubject != null) && (r.AppointmentResponsibleSubject.IsOfType <EmployeeGroup>()) &&
                                                      ((((EmployeeGroup)r.AppointmentResponsibleSubject).Name != null) && ((EmployeeGroup)r.AppointmentResponsibleSubject).Name.ToLower()
                                                       .Contains(searchText))) ||
                                                     ((r.RelatedSeriesName != null) && r.RelatedSeriesName.ToLower()
                                                      .Contains(searchText)));

            return(searchResult);
        }
        private IEnumerable <FillLevelReadingViewModel> SearchInReadingList()
        {
            if (string.IsNullOrEmpty(ReadingSearchText))
            {
                return(m_FillLevelReadings);
            }
            var searchText = ReadingSearchText.ToLower();

            var searchResult = m_FillLevelReadings.Where(r => (((r.ContainerViewModel.Name != null) && (r.ContainerViewModel.Name.ToLower()
                                                                                                        .Contains(searchText))) ||
                                                               ((r.ContainerViewModel.SelectedAvvWasteTypes != null) &&
                                                                (r.ContainerViewModel.SelectedAvvWasteTypes.Contains(r.ContainerViewModel.SelectedAvvWasteTypes.FirstOrDefault(wt => wt.Number.ToString()
                                                                                                                                                                               .Contains(searchText))))) ||
                                                               ((r.AppointmentResponsibleSubject != null) && (r.AppointmentResponsibleSubject.IsOfType <Employee>()) &&
                                                                ((((Employee)r.AppointmentResponsibleSubject).FirstName != null) && ((Employee)r.AppointmentResponsibleSubject).FirstName.ToLower()
                                                                 .Contains(searchText)) ||
                                                                ((((Employee)r.AppointmentResponsibleSubject).LastName != null) && ((Employee)r.AppointmentResponsibleSubject).LastName.ToLower()
                                                                 .Contains(searchText)) ||
                                                                (((Employee)r.AppointmentResponsibleSubject).Number != null) && ((Employee)r.AppointmentResponsibleSubject).Number.ToLower()
                                                                .Contains(searchText))) ||
                                                         ((r.AppointmentResponsibleSubject != null) && (r.AppointmentResponsibleSubject.IsOfType <EmployeeGroup>()) &&
                                                          ((((EmployeeGroup)r.AppointmentResponsibleSubject).Name != null) && ((EmployeeGroup)r.AppointmentResponsibleSubject).Name.ToLower()
                                                           .Contains(searchText))) ||
                                                         ((r.RelatedSeriesName != null) && r.RelatedSeriesName.ToLower()
                                                          .Contains(searchText)));

            return(searchResult);
        }