示例#1
0
 public RoomInformation(Hotel hotel)
 {
     InitializeComponent();
     this.hotel = hotel;
 }
示例#2
0
 private void Hotel_SaveBtn_Click(object sender, EventArgs e)
 {
     if (!Hotel.IsSet(Init_HotelNameTbx.Text) || !Hotel.IsSet(Init_CountryTbx.Text) || !Hotel.IsSet(Init_CityTbx.Text) || !Hotel.IsSet(Init_RatingLbx.Text))
     {
         MessageBox.Show("Please fill in all forms.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         dbCon.Update("INSERT INTO hotel(id, hotelName, country, city, rating) VALUES ('1', '" + Init_HotelNameTbx.Text + "', '" +
                      Init_CountryTbx.Text + "', '" +
                      Init_CityTbx.Text + "', '" +
                      Init_RatingLbx.Text + "');");
         MessageBox.Show("Your changes have been saved to the database. Welcome to " + Init_HotelNameTbx.Text + "!", "Saved changes!", MessageBoxButtons.OK, MessageBoxIcon.Information);
         initiate.CreateKey();
         this.Close();
     }
 }