private void GetItemInfo() { List <ItemsModel> list = PrepAndPaintDB.GetItemsList(); foreach (var item in list) { itemsListBox.Items.Add(item.ItemName); } }
private void BtnAddNewItem_Click(object sender, EventArgs e) { if (IsValidate()) { char[] a = txtItemName.Text.ToLower().ToCharArray(); a[0] = char.ToUpper(a[0]); ItemsModel newItem = new ItemsModel() { ItemName = new string(a) }; itemsList = PrepAndPaintDB.GetItemsList(); foreach (var item in itemsList) { if (item.ItemName == newItem.ItemName) { MessageBox.Show($" Item: {newItem.ItemName} already exist", "Exit already!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtItemName.Focus(); return; } } itemName = PrepAndPaintDB.AddItem(newItem); DialogResult = DialogResult.OK; } }
private void PopulateListView() { itemDataGridView.DataSource = PrepAndPaintDB.GetItemsList(); itemDataGridView.Columns[0].Visible = false; }
private void GetItemList() { cmboBodyDoors.DisplayMember = "ItemName"; cmboBodyDoors.DataSource = PrepAndPaintDB.GetItemsList(); }