private void GetChairItems() { DataTable dataTable = firebirdClient.GetDataTable( Properties.Settings.Default.DataBaseSqlQueryGetChairs, new Dictionary <string, object>()); if (dataTable.Rows.Count == 0) { MessageBox.Show(Window.GetWindow(this), "Не удалось получить список кресел. Проверьте подключение к БД в разделе 'Внутренние настройки'.", "Ошибка БД", MessageBoxButton.OK, MessageBoxImage.Warning); return; } foreach (DataRow row in dataTable.Rows) { try { string chid = row["CHID"].ToString(); string chname = row["CHNAME"].ToString(); string rnum = row["RNUM"].ToString(); string rname = row["RNAME"].ToString(); Infoscreen.Configuration.ItemSystem.ItemChair chair = new Infoscreen.Configuration.ItemSystem.ItemChair() { ChairID = chid, ChairName = chname, RoomNumber = rnum, RoomName = rname }; Application.Current.Dispatcher.BeginInvoke((Action)(() => { chairItemsCache.Add(chair); })); } catch (Exception exc) { MessageBox.Show(Application.Current.MainWindow, exc.Message + Environment.NewLine + exc.StackTrace, "", MessageBoxButton.OK, MessageBoxImage.Error); } } }
private bool FilterByRoomNumber(Infoscreen.Configuration.ItemSystem.ItemChair itemChair) { return(SearchByRoomNumber == null || itemChair.RoomNumber.Contains(SearchByRoomNumber)); }