示例#1
0
 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);
     }
 }
示例#2
0
        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;

        }
示例#3
0
 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);
         } 
     }
 }
示例#4
0
 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);
         }
     }
 }
示例#5
0
 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 = "Выберите источник";
     }
 }
示例#6
0
 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);
         }
     }
 }
示例#7
0
 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);
         }
     }
 }
示例#8
0
 public AddGoodsItemForm(ListBoxItem category)
 {
     InitializeComponent();
     FillForm();
     addGoodsCategoryComboBox.SelectedIndex = addGoodsCategoryComboBox.FindString(category.Name);
 }