private void txttransferroom_LostFocus(object sender, RoutedEventArgs e)
 {
     try
     {
         Checksin  c  = new Checksin();
         DataTable dt = c.roomchange();
         if (dt.Rows.Count == 0)
         {
             if (txtmainroom.Text == txttransferroom.Text)
             {
                 txttransferroom.Text = "";
                 //MessageBox.Show("please enter the vacant room ?");
                 pop2.IsOpen = true;
             }
             else
             {
             }
         }
         else
         {
             txttransferroom.Text = "";
             //MessageBox.Show("please enter the vacant room");
             pop2.IsOpen = true;
         }
     }
     catch (Exception) { }
 }
 private void txtmainroom_LostFocus(object sender, RoutedEventArgs e)
 {
     try
     {
         Checksin c = new Checksin();
         c.ROOM_NO = txtmainroom.Text;
         DataTable dt = c.roomchange();
         if (dt.Rows.Count == 0)
         {
             txtmainroom.Text = "";
             pop3.IsOpen      = true;
             //MessageBox.Show("Please Enter the Occupied Room");
         }
         else
         {
             txtguestname.Text      = dt.Rows[0]["FIRSTNAME"].ToString();
             txtgueststatus.Text    = dt.Rows[0]["STATUS"].ToString();
             txtarrivaldate.Text    = dt.Rows[0]["ARRIVAL_DATE"].ToString();
             txtdeparturedate.Text  = dt.Rows[0]["DEPARTURE_DATE"].ToString();
             txtguestname1.Text     = dt.Rows[0]["FIRSTNAME"].ToString();
             txtgueststatus1.Text   = dt.Rows[0]["STATUS"].ToString();
             txtarrivaldate1.Text   = dt.Rows[0]["ARRIVAL_DATE"].ToString();
             txtdeparturedate1.Text = dt.Rows[0]["DEPARTURE_DATE"].ToString();
         }
     }
     catch (Exception) { }
 }
 private void txtswap_LostFocus(object sender, RoutedEventArgs e)
 {
     try
     {
         Checksin c = new Checksin();
         c.ROOM_NO = txtswap.Text;
         c.roomchange();
         txtguestname2.Text     = c.FIRSTNAME;
         txtgueststatus2.Text   = c.status;
         txtarrivaldate2.Text   = Convert.ToDateTime(c.ARRIVAL_DATE).ToString();
         txtdeparturedate2.Text = Convert.ToDateTime(c.DEPARTURE_DATE).ToString();
     }
     catch (Exception) { }
 }