private void btnAddMachine_Click(object sender, EventArgs e) { try { if (CC.CheckConnection() == true) { AddMachine TM = new AddMachine(); TM.Show(); } } catch (Exception) { MessageBox.Show("Connection error"); } }
private void btnShowMachine_Click(object sender, EventArgs e) { try { AddMachine TM = new AddMachine(libDemoNumber.SelectedItem.ToString()); if (CC.CheckConnection() == true) { TM.Show(); } else { MessageBox.Show("Connection error"); } } catch (Exception) { MessageBox.Show("Error: Machine not chosen"); } }
private void btnShow_Click(object sender, EventArgs e) { try { string s = libBookingID.SelectedItem.ToString(); int bookingID = Convert.ToInt32(s); if (bookingID != 0) { try { string demonumber = libDemoNumber.SelectedItem.ToString(); if (demonumber != "" || demonumber != "-1") { AddMachine am = new AddMachine(demonumber); am.Show(); } else { ShowBooking sb = new ShowBooking(bookingID); sb.Show(); } } catch (Exception) { ShowBooking sb = new ShowBooking(bookingID); sb.Show(); } } else { MessageBox.Show("Booking not selected"); } } catch (Exception) { MessageBox.Show("Booking not selected"); } }