示例#1
0
 private void PackageNameCombo_SelectedIndexChanged(object sender, EventArgs e)
 {
     name = PackageNameCombo.SelectedItem.ToString();
     info = Package_Product_SupplierDB.getPackageinfo(name);
     DisplayBox_info(info);
     btlDelete.Visible = true;
     btlInsert.Visible = true;
 }
示例#2
0
        private void btlInsert_Click(object sender, EventArgs e)
        {
            SearchForm Insert_window = new SearchForm(name, info);

            Insert_window.ShowDialog(this); //this line will prevent the code after it executing if the
            name = PackageNameCombo.SelectedItem.ToString();
            info = Package_Product_SupplierDB.getPackageinfo(name);
            DisplayBox_info(info);
        }
示例#3
0
 private void btlDelete_Click(object sender, EventArgs e)
 {
     if (product_supplier_packageBox.SelectedRows.Count > 0)
     {
         package_product_supplier itemToDelete = (package_product_supplier)product_supplier_packageBox.SelectedRows[0].DataBoundItem;
         Package_Product_SupplierDB.delete_info(itemToDelete.package_id, itemToDelete.Product_id, itemToDelete.supplier_id);
         name = PackageNameCombo.SelectedItem.ToString();
         info = Package_Product_SupplierDB.getPackageinfo(name);
         DisplayBox_info(info);
     }
     else
     {
         MessageBox.Show("need to choose a row first");
     }
 }