title: how to add first waiting list passenger to the seat list after someone cancelled his seat in c#?
body: <blockquote>
    <p>I am working on an airline reservation project by using C# windows form. Click “Cancel” to delete the passenger’s booking .If the waiting list is not empty, remove the first person from the list and give her/him the newly vacated seat. Any idea? 
    Here is my code:></p>
  </blockquote>
  
  <pre><code>private void deleteClick(object sender, EventArgs e)
          {
              // enter name and validate it
              //validate input
              row = rowListBox.GetItemText(rowListBox.SelectedItem);
              column = seatListBox.GetItemText(seatListBox.SelectedItem);
              if (row.Equals(""))
              {
                  MessageBox.Show("Row selection is needed", "Error",
                   MessageBoxButtons.OK, MessageBoxIcon.Information);
                  return;
              }
              if (column.Equals(""))
              {
                  MessageBox.Show("Seat selection is needed", "Error",
                  MessageBoxButtons.OK, MessageBoxIcon.Information);
                  return;
              }
  
              // delete passenger from the list
              rowNumber = int.Parse(row);
  
              for (int r = 0; r &lt; 5; r++)
              {
                  for (int c = 0; c &lt; 4; c++)
                  {
                      if (c == 0)
                      {
                          col = "A";
                      }
                      else if (c == 1)
                      {
                          col = "B";
                      }
                      else if (c == 2)
                      {
                          col = "C";
                      }
                      else
                      {
                          col = "D";
                      }
  
                      if (rowNumber == r + 1 &amp;&amp; column == col &amp;&amp; seating[r, c] == null)
                      {
                          MessageBox.Show("Seat is not taken. Please select a different seat", "Seat Taken",
                          MessageBoxButtons.OK, MessageBoxIcon.Information);
                      }
                      else if (rowNumber == r + 1 &amp;&amp; column == col &amp;&amp; seating[r, c] != null)
                      {
                          seating[r, c] = "";
                          isTaken[r, c] = false;
                          count--;
                          output += (r + 1) + col + "-" + seating[r, c] + "\n";
                      }
                      else
                      {
                          isTaken[r, c] = false;
                          output += (r + 1) + col + "-" + "\n";
                      }
  
                  }
              }
      }
  </code></pre>