//saves an hotel
 private void saveHotel()
 {
     try
     {
         if (!cmbHotelByLocation.Enabled)
         {
             Model.Hotel mAirport = new Model.Hotel();
             int         select   = dgvAirport.CurrentCell.RowIndex;
             mAirport.name       = dgvHotel.Rows[select].Cells["cHotelName"].Value.ToString();
             mAirport.roomAmount = Convert.ToInt32(dgvHotel.Rows[select].Cells["cHotelRooms"].Value.ToString());
             mAirport.id         = Convert.ToInt32(dgvHotel.Rows[select].Cells["cHotelId"].Value.ToString());
             mAirport.idPlace    = Convert.ToInt32(dgvHotel.Rows[select].Cells["cHotelPlace"].Value.ToString());
             Controller.Hotel cAirport = new Controller.Hotel(mAirport);
             cAirport.insert();
             refreshHotel();
             return;
         }
         else
         {
             Model.Hotel mAirport = new Model.Hotel();
             mAirport.name       = dgvHotel.Rows[dgvHotel.Rows.Count - 1].Cells["cHotelName"].Value.ToString();
             mAirport.roomAmount = Convert.ToInt32(dgvHotel.Rows[dgvHotel.Rows.Count - 1].Cells["cHotelRooms"].Value.ToString());
             mAirport.idPlace    = Convert.ToInt32(cmbHotelByLocation.SelectedValue);;
             Controller.Hotel cAirport = new Controller.Hotel(mAirport);
             cAirport.insert();
         }
         refreshHotel();
     }
     catch
     {
     }
 }
 //Hotel's actions
 private void doHotel()
 {
     Model.Hotel      mAirport = new Model.Hotel();
     Controller.Hotel cAirport = new Controller.Hotel();
     if (cmbHotelAction.SelectedIndex == 0)//insert
     {
         MessageBox.Show("Please, choose an action!");
     }
     else if (cmbHotelAction.SelectedIndex == 1)//insert
     {
         saveHotel();
     }
     else if (cmbHotelAction.SelectedIndex == 2)//delete
     {
         int select = dgvAirport.CurrentCell.RowIndex;
         mAirport.id = Convert.ToInt32(dgvHotel.Rows[select].Cells["cHotelId"].Value.ToString());
         cAirport    = new Controller.Hotel(mAirport);
         cAirport.delete();
         refreshHotel();
     }
     else if (cmbHotelAction.SelectedIndex == 3)//update
     {
         dgvHotel.Enabled = true;
         saveHotel();
     }
     else if (cmbHotelAction.SelectedIndex == 4)//refresh
     {
         refreshHotel();
     }
 }
        //loads all the hotels
        private void refreshHotel()
        {
            try
            {
                dgvHotel.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

                Controller.Hotel cPlace    = new Controller.Hotel();
                DataTable        dtAirport = cPlace.select();
                dgvHotel.Rows.Clear();

                foreach (DataRow row in dtAirport.Rows)
                {
                    dgvHotel.Rows.Add(row["id"], row["name"], row["id_place"], row["room_ammount"]);
                }

                cmbHotelRate.DisplayMember = "Name";
                cmbHotelRate.ValueMember   = "id";
                cmbHotelRate.DataSource    = dtAirport;
            }
            catch
            {
            }
        }