private void btnAdd_Click(object sender, EventArgs e) { if (Global.supply_categoryID_passer == "") { frmAddSupplierItems addSupplierCategory = new frmAddSupplierItems(); addSupplierCategory.ShowDialog(); frmSupplier supplier = new frmSupplier(); ListViewItem item = new ListViewItem(); int max = lvwItemSold.Items.Count; item = lvwItemSold.Items.Add(frmSupplier.Global.supply_itemsID_passer); item.SubItems.Add(frmSupplier.Global.supply_categoryID_passer); item.SubItems.Add(frmSupplier.Global.category_name_passer); item.SubItems.Add(frmSupplier.Global.supply_name_passer); //for (int index = 0; index < max; index++) //{ // if (lvwItemSold.Items[index].Text == Global.supply_itemsID_passer) // { // try // { // //4 // lvwItemSold.Items.Remove(lvwItemSold.Items[index]); // lvwItemSold.Items[index].SubItems.Remove(item.SubItems[index]); // lvwItemSold.Items[index].SubItems.Remove(item.SubItems[index]); // lvwItemSold.Items[index].SubItems.Remove(item.SubItems[index]); // lvwItemSold.Items[index].SubItems.Remove(item.SubItems[index]); // lvwItemSold.Items[index].SubItems.Remove(item.SubItems[index]); // lvwItemSold.Items[index].SubItems.Remove(item.SubItems[index]); // item = lvwItemSold.Items.Add(frmSupplier.Global.supply_itemsID_passer); // item.SubItems.Add(frmSupplier.Global.supply_categoryID_passer); // item.SubItems.Add(frmSupplier.Global.category_name_passer); // item.SubItems.Add(frmSupplier.Global.supply_name_passer); // } // catch { } // } // //Should get Category ID, Supplier ID, Supply Items ID, Category Name, Supply Name //} supply_categoryID = ""; validationAddSuppliers(); Global.supply_categoryID_passer = ""; } else { Global.supply_categoryID_passer = ""; } }
private void btnSuppliers_Click(object sender, EventArgs e) { frmSupplier formSuppliersList = new frmSupplier(); formSuppliersList.ShowDialog(); }