Esempio n. 1
0
 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");
     }
 }
Esempio n. 2
0
        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");
            }
        }
Esempio n. 3
0
        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");
            }
        }