Beispiel #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);
     }
 }
Beispiel #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;

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