private void Window_Loaded(object sender, RoutedEventArgs e) { WpfApp1.Food_Orders_DBDataSet food_Orders_DBDataSet = ((WpfApp1.Food_Orders_DBDataSet)(this.FindResource("food_Orders_DBDataSet"))); // Загрузить данные в таблицу Группы. Можно изменить этот код как требуется. WpfApp1.Food_Orders_DBDataSetTableAdapters.ГруппыTableAdapter food_Orders_DBDataSetГруппыTableAdapter = new WpfApp1.Food_Orders_DBDataSetTableAdapters.ГруппыTableAdapter(); food_Orders_DBDataSetГруппыTableAdapter.Fill(food_Orders_DBDataSet.Группы); System.Windows.Data.CollectionViewSource группыViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("группыViewSource"))); группыViewSource.View.MoveCurrentToFirst(); // TODO: Добавить сюда код, чтобы загрузить данные в таблицу ElemFromGroups. // Не удалось создать этот код, поскольку метод food_Orders_DBDataSetElemFromGroupsTableAdapter.Fill отсутствует или имеет неизвестные параметры. ElemFromGroup(); // TODO: Добавить сюда код, чтобы загрузить данные в таблицу Ingredients. // Не удалось создать этот код, поскольку метод food_Orders_DBDataSetIngredientsTableAdapter.Fill отсутствует или имеет неизвестные параметры. WpfApp1.Food_Orders_DBDataSetTableAdapters.IngredientsTableAdapter food_Orders_DBDataSetIngredientsTableAdapter = new WpfApp1.Food_Orders_DBDataSetTableAdapters.IngredientsTableAdapter(); System.Windows.Data.CollectionViewSource ingredientsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("ingredientsViewSource"))); ingredientsViewSource.View.MoveCurrentToFirst(); }
private void showIngredients() { DataGridCell cell = GetCell(elemFromGroupsDataGrid.SelectedIndex, 0, elemFromGroupsDataGrid); TextBlock tb1 = cell.Content as TextBlock; наименованиеTextBox.Text = tb1.Text; WpfApp1.Food_Orders_DBDataSet food_Orders_DBDataSet = ((WpfApp1.Food_Orders_DBDataSet)(this.FindResource("food_Orders_DBDataSet"))); WpfApp1.Food_Orders_DBDataSetTableAdapters.IngredientsTableAdapter food_Orders_DBDataSetIngredientsTableAdapter = new WpfApp1.Food_Orders_DBDataSetTableAdapters.IngredientsTableAdapter(); System.Windows.Data.CollectionViewSource ingredientsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("ingredientsViewSource"))); food_Orders_DBDataSetIngredientsTableAdapter.GetData(tb1.Text); food_Orders_DBDataSetIngredientsTableAdapter.Fill(food_Orders_DBDataSet.Ingredients, tb1.Text); ingredientsViewSource.View.MoveCurrentToFirst(); //WpfApp1.Food_Orders_DBDataSet food_Orders_DBDataSet = ((WpfApp1.Food_Orders_DBDataSet)(this.FindResource("food_Orders_DBDataSet"))); WpfApp1.Food_Orders_DBDataSetTableAdapters.QueriesTableAdapter food_Orders_DBDataSetCountTableAdapter = new WpfApp1.Food_Orders_DBDataSetTableAdapters.QueriesTableAdapter(); суммаTextBox.Text = food_Orders_DBDataSetCountTableAdapter.CountSummF(Convert.ToInt32(KolichTBX.Text), наименованиеTextBox.Text).ToString(); }