private void btnAddFacility_Click(object sender, EventArgs e) { FacilityManagementForm fmForm = new FacilityManagementForm(); fmForm.action = "Add"; if (fmForm.ShowDialog() == DialogResult.OK) { this.Controls.Clear(); InitializeComponent(); FormFacilities_Load(null, EventArgs.Empty); } }
void facilityEvent(object sender, MouseEventArgs e) { FacilityItem currentItem = (FacilityItem)sender; //show dialog FacilityManagementForm fmForm = new FacilityManagementForm(); fmForm.fID = currentItem.fID; fmForm.facility = currentItem.ItemLabel; fmForm.availability = currentItem.Availability; fmForm.capacity = currentItem.Capacity; fmForm.image = currentItem.ItemImage; fmForm.action = "Edit"; if (fmForm.ShowDialog() == DialogResult.OK) { this.Controls.Clear(); InitializeComponent(); FormFacilities_Load(null, EventArgs.Empty); } }