예제 #1
0
        //Buttons (add/edit or delete)
        private void btnAddSupplier_Click(object sender, EventArgs e)
        {
            disableButtons();
            Supplier     supplier    = new Supplier();
            SupplierForm addSupplier = new SupplierForm(supplier);

            addSupplier.Show();
        }
예제 #2
0
 private void btnEditSupplier_Click(object sender, EventArgs e)
 {
     if (LV_Suppliers.SelectedItems.Count > 0)
     {
         //uses selected value to find in the DB and passes it through in the next form
         var          SupplierID       = LV_Suppliers.SelectedItems[0].Tag;
         Supplier     SelectedSupplier = Program.db.Suppliers.Find(SupplierID);
         SupplierForm EditSupplier     = new SupplierForm(SelectedSupplier);
         disableButtons();
         EditSupplier.Show();
     }
 }