Esempio n. 1
0
 // Home vacation stuff
 private void btnCreateHouse_Click(object sender, RoutedEventArgs e)
 {
     if (destinationName == "")
     {
         lblVacationError.Content    = "Select destination from list";
         lblVacationError.Visibility = Visibility.Visible;
     }
     else
     {
         if (tBoxPersons.Text != "" && tBoxShopping.Text != "" && tBoxBeach.Text != "" && tBoxDescription.Text != "")
         {
             lblVacationError.Visibility = Visibility.Hidden;
             VacationHouse v = new VacationHouse(tBoxDescription.Text, Convert.ToInt32(tBoxPersons.Text), Convert.ToInt32(tBoxShopping.Text), Convert.ToInt32(tBoxBeach.Text));
             Service.Instance.createVacationHouse(v, destinationName);
             IDHouse = Service.Instance.getVacationHouseId(v);
             clearHouse();
             VacationHomeWeeksWindow vacationHomeWeeksWindow = new VacationHomeWeeksWindow(IDHouse, 0);
             vacationHomeWeeksWindow.Show();
             this.Hide();
         }
         else
         {
             lblVacationError.Content    = "Fill all boxes";
             lblVacationError.Visibility = Visibility.Visible;
         }
     }
     loadTables();
 }
Esempio n. 2
0
 private void btnUpdateWeeks_Click(object sender, RoutedEventArgs e)
 {
     if (IDHouse != -1)
     {
         lblVacationError.Visibility = Visibility.Hidden;
         VacationHomeWeeksWindow vacationHomeWeeksWindow = new VacationHomeWeeksWindow(IDHouse, 1);
         clearHouse();
         vacationHomeWeeksWindow.Show();
         this.Hide();
     }
     else
     {
         lblVacationError.Content    = "Please select a vacation house";
         lblVacationError.Visibility = Visibility.Visible;
     }
 }