Beispiel #1
0
        private void FormABMHotelModify_Load(object sender, EventArgs e)
        {
            this.ControlBox      = false;
            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState     = FormWindowState.Maximized;

            reloadGrid();
            Star.fillComboBox(comboBoxStar);

            if (edit)
            {
                Hotel hotelData = HotelHelper.getHotelData(hotelId);

                this.textBoxName.Text           = hotelData.name;
                this.textBoxMail.Text           = hotelData.mail;
                this.textBoxTelephone.Text      = hotelData.telephone;
                this.textBoxAddress.Text        = hotelData.address;
                this.textBoxAddressNumber.Text  = hotelData.addressNumber.ToString();
                this.textBoxCity.Text           = hotelData.city;
                this.textBoxCountry.Text        = hotelData.country;
                this.dtCreation.Value           = hotelData.creation;
                this.comboBoxStar.SelectedIndex = this.comboBoxStar.FindStringExact(hotelData.star.ToString());
                this.buttonSave.Text            = "Editar hotel";
            }
        }
Beispiel #2
0
 private void saveOrUpdate(Hotel hotelData)
 {
     HotelHelper.save(hotelData);
     if (edit)
     {
         MessageBox.Show("Modificacion de hotel realizada con exito");
     }
     else
     {
         MessageBox.Show("Creacion de hotel realizada con exito. Modifiquelo para agregar un regimen");
     }
     this.closeWindow();
 }
        private void buttonAccept_Click(object sender, EventArgs e)
        {
            Period period = this.getDataFromForm();

            if (period != null)
            {
                Boolean addOk = HotelHelper.closePeriod(hotelId, period);
                if (addOk)
                {
                    MessageBox.Show("Se agrego correctamente periodo cerrado");
                    this.closeWindow();
                }
                else
                {
                    MessageBox.Show("Existen reserva o estadia para el momento elegido");
                }
            }
        }
Beispiel #4
0
        private void buttonSearch_Click(object sender, EventArgs e)
        {
            Hotel hotel = this.getDataToSearch();

            HotelHelper.search(hotel, dgvHotel);
        }