Exemplo n.º 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);
     }
 }
Exemplo n.º 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;

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