private void manageSuppliersToolStripMenuItem_Click(object sender, EventArgs e) { var supplierlist = new ManageSupplierListing { MdiParent = this }; supplierlist.Show(); }
//Using same window form for Add Edit. Titles will be different depending on if it was add or edit public AddEditSupplier(ManageSupplierListing manageSupplierListing = null) { InitializeComponent(); lblSupTitle.Text = "Add New Supplier"; this.Text = "Add New Supplier"; isEditMode = false; _manageSupplierListing = manageSupplierListing; _db = new TravelExpertsEntities(); }
public AddEditSupplier(Supplier supplierToEdit, ManageSupplierListing manageSupplierListing = null) { InitializeComponent(); lblSupTitle.Text = "Edit Suppliers"; this.Text = "Edit Suppliers"; _manageSupplierListing = manageSupplierListing; if (supplierToEdit == null) { MessageBox.Show("Please ensure you selected a valid Supplier to edit"); Close(); } else { isEditMode = true; _db = new TravelExpertsEntities(); PopulateFields(supplierToEdit); } }