Exemplo n.º 1
0
        private void GetItemInfo()
        {
            List <ItemsModel> list = PrepAndPaintDB.GetItemsList();

            foreach (var item in list)
            {
                itemsListBox.Items.Add(item.ItemName);
            }
        }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
 private void PopulateListView()
 {
     itemDataGridView.DataSource         = PrepAndPaintDB.GetItemsList();
     itemDataGridView.Columns[0].Visible = false;
 }
Exemplo n.º 4
0
 private void GetItemList()
 {
     cmboBodyDoors.DisplayMember = "ItemName";
     cmboBodyDoors.DataSource    = PrepAndPaintDB.GetItemsList();
 }