Пример #1
0
        private void btnShow_Click(object sender, EventArgs e)
        {
            try
            {
                string s = lbBookings.SelectedItem.ToString();
                int    bookingIDSelected = Convert.ToInt32(lbBookings.SelectedItem);


                try
                {
                    CC.SetBookingID(bookingIDSelected);
                    ShowBooking SB = new ShowBooking(bookingIDSelected);
                    SB.Show();
                    this.Visible = false;
                }
                catch (Exception)
                {
                    MessageBox.Show("Connection error");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error: Booking not found");
            }
        }
Пример #2
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");
            }
        }
Пример #3
0
        private void btnShow_Click(object sender, EventArgs e)
        {
            try
            {
                if (CC.CheckConnection() == true)
                {
                    string      lib = CC.BookingIntSpawner(libBookingID.SelectedItem.ToString());
                    int         bookingIDSelected = Convert.ToInt32(lib);
                    ShowBooking SB = new ShowBooking(bookingIDSelected);
                    SB.Show();
                    this.Visible = false;
                }

                else
                {
                    MessageBox.Show("Connection error");
                }
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("Error: Booking not found");
            }
        }