private void UpdateComboBoxCategory() { var categories = db.Categories.ToList(); foreach (var category in categories) { var item = new ListBoxItem(category.Id, category.Name); chekCategoryComboBox.Items.Add(item); } }
public AddGoodsItemForm(ListBoxItem category, UnitOfMeasure unitOfMeasure, string value) { InitializeComponent(); FillForm(); addGoodsCategoryComboBox.SelectedIndex = addGoodsCategoryComboBox.FindString(category.Name); addGoodsUnitOfMeasureComboBox.SelectedIndex = addGoodsUnitOfMeasureComboBox.FindString(unitOfMeasure.Name); addGoodsItemTextBox.Text = value; }
private void UpdateComboBoxCategory() { using (var db = new Model.BudgetModel()) { var categories = db.Categories.ToList(); foreach (var category in categories) { var item = new ListBoxItem(category.Id, category.Name); goodsItemComboBox.Items.Add(item); } } }
private void FillForm() { using (var db = new Model.BudgetModel()) { var categories = db.Categories.ToList(); foreach (var category in categories) { var item = new ListBoxItem(category.Id, category.Name); addGoodsCategoryComboBox.Items.Add(item); } var unitOfMeasures = db.UnitOfMeasures.ToList(); foreach (var unitOfMeasure in unitOfMeasures) { var item = new ComplexListBoxItem(unitOfMeasure.Id, unitOfMeasure.Name, unitOfMeasure.ShortName); addGoodsUnitOfMeasureComboBox.Items.Add(item); } } }
private void UpdateComboBox() { using (var db = new Model.BudgetModel()) { var sources = db.Sources.ToList(); foreach(var source in sources) { var item = new ListBoxItem(source.Id, source.Name); purchaseComboBox.Items.Add(item); } purchaseComboBox.Text = "Выберите источник"; } }
private void UpdateListBox() { sourcesListBox.Items.Clear(); using (var db = new Model.BudgetModel()) { var sources = db.Sources.ToList(); foreach (var source in sources) { var item = new ListBoxItem(source.Id, source.Name); sourcesListBox.Items.Add(item); } } }
private void UpdateListBox() { categoriesListBox.Items.Clear(); using (var db = new Model.BudgetModel()) { var categories = db.Categories.ToList(); foreach (var category in categories) { var item = new ListBoxItem(category.Id, category.Name); categoriesListBox.Items.Add(item); } } }
public AddGoodsItemForm(ListBoxItem category) { InitializeComponent(); FillForm(); addGoodsCategoryComboBox.SelectedIndex = addGoodsCategoryComboBox.FindString(category.Name); }