Ejemplo n.º 1
0
 public Hotel(Infrastructure.DB.Hotel hotel, MainWindow parent)
 {
     InitializeComponent();
     TBLand.ItemsSource       = Infrastructure.Land.Lesen_Alle();
     TBLand.DisplayMemberPath = "Name";
     TBLand.SelectedValuePath = "LandID";
     currentHotel             = hotel;
     LoadEntity(hotel);
     workingStatus     = EWorkingStatus.MODIFY;
     this.parent       = parent;
     this.hasParent    = true;
     this.parent.Title = hotel.Name;
 }
Ejemplo n.º 2
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     if (hasParent)
     {
         this.parent.Title = "List";
         this.parent.showPlace.Children.Clear();
         this.parent.showPlace.Children.Add(new HotelList(parent));
     }
     else
     {
         workingStatus = EWorkingStatus.CANCEL;
         clearAllFiels();
         MessageBox.Show("Der Vorgang wurde abgebrochen", "Abbrechen", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }
Ejemplo n.º 3
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            long id;

            if (!String.IsNullOrEmpty(TBSearch.Text) && long.TryParse(TBSearch.Text, out id))
            {
                this.currentHotel = Infrastructure.Hotel.Lesen_HotelID(id);
                if (this.currentHotel != null)
                {
                    LoadEntity(this.currentHotel);
                    workingStatus = EWorkingStatus.MODIFY;
                }
                else
                {
                    MessageBox.Show("Das Hotel mit der eingegebenen Id konnte nicht gefunden werden", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Ejemplo n.º 4
0
 private void neu_Click(object sender, RoutedEventArgs e)
 {
     workingStatus = EWorkingStatus.CREATE;
     clearAllFiels();
     this.currentHotel = null;
 }