Ejemplo n.º 1
0
 private void Bt_changePriceAttraction_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (ModifyService.updatePriceAttraction(lb_priceAttraction.SelectedValue.ToString(), double.Parse(tb_prmodifyNewPrice.Text), cal_prmodifyWhenStart.SelectedDates.First(), cal_prmodifyWhenStart.SelectedDates.Last()))
         {
             MessageBox.Show("Zaaktualizowano cenę atrakcji");
             tb_prmodifyNewPrice.Text = "";
             tb_prmodifyOldPrice.Text = ModifyService.getPriceAttraction(lb_priceAttraction.SelectedValue.ToString()).ToString();
             gd_planned.ItemsSource   = ModifyService.getAttractionTimePeriods(lb_priceAttraction.SelectedValue.ToString());
         }
         else
         {
             MessageBox.Show("Błędna cena, data już zaplanowana lub z przeszłości");
         }
     }
     catch (InvalidOperationException)
     {
         MessageBox.Show("Nie wybrano zakresu obowiązywania");
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("Nie wybrano zakresu obowiązywania lub atrakcji");
     }
     catch (FormatException)
     {
         MessageBox.Show("Nie wybrano nowej ceny");
     }
 }
Ejemplo n.º 2
0
 private void Lb_priceAttraction_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     bt_changePrice.Visibility           = Visibility.Hidden;
     bt_changePriceAttraction.Visibility = Visibility.Visible;
     if (lb_priceAttraction.SelectedValue != null)
     {
         tb_prmodifyOldPrice.Text = ModifyService.getPriceAttraction(lb_priceAttraction.SelectedValue.ToString()).ToString();
     }
     gd_planned.ItemsSource = ModifyService.getAttractionTimePeriods(lb_priceAttraction.SelectedValue.ToString());
 }