예제 #1
0
 private void comboBox7_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox7.Text != "Select Room")
     {
         comboBox8.Items.Clear();
         comboBox8.Items.Add("Select Bed");
         comboBox8.Text    = "Select Bed";
         comboBox8.Enabled = true;
         PlaceAppointmentmysql roomfee = new PlaceAppointmentmysql();
         textBox15.Text = roomfee.FindRoomFee(int.Parse(comboBox4.Text), int.Parse(comboBox7.Text));
         List <string> beds = roomfee.freeBeds(int.Parse(comboBox4.Text), int.Parse(comboBox7.Text));
         if (beds == null)
         {
             comboBox8.Text    = "No free beds";
             comboBox8.Enabled = false;
         }
         else
         {
             foreach (var item in beds)
             {
                 comboBox8.Items.Add(item);
             }
         }
     }
     else
     {
         comboBox8.Items.Clear();
         comboBox8.Items.Add("Select Bed");
         comboBox8.Text    = "Select Bed";
         comboBox8.Enabled = false;
         textBox15.Text    = null;
     }
 }