public AddGuestRequestPage(BlApi.IBl bl, BO.Client client, ListBox listBox)
 {
     //
     InitializeComponent();
     guest = new BO.GuestRequest();
     AddRequest.DataContext = guest;
     this.bl                = bl;
     this.clientID          = client.Details.Id;
     this.Client            = client;
     this.listBox           = listBox;
     guest.ClientID         = clientID;
     guest.RegistrationDate = DateTime.Today;
     #region  convert enums for Add
     typeComboBox.ItemsSource = MyDictionary.HostingTypes.Select(x => MyDictionary.TranslateEnumToString(x));
     areaComboBox.ItemsSource = MyDictionary.Locations.Select(x => MyDictionary.TranslateEnumToString(x));
     childrensAttractionsComboBox.ItemsSource = MyDictionary.Preferences.Select(x => MyDictionary.TranslateEnumToString(x));
     gardenComboBox.ItemsSource  = MyDictionary.Preferences.Select(x => MyDictionary.TranslateEnumToString(x));
     poolComboBox.ItemsSource    = MyDictionary.Preferences.Select(x => MyDictionary.TranslateEnumToString(x));
     jacuzziComboBox.ItemsSource = MyDictionary.Preferences.Select(x => MyDictionary.TranslateEnumToString(x));
     #endregion
     XElement cities = XElement.Load(@"XML\CitiesList.xml");
     childrenComboBox.ItemsSource  = Numbers.ArrayNumbers;
     adultsComboBox.ItemsSource    = Numbers.ArrayNumbers;
     subAreaComboBox.ItemsSource   = cities.Elements().Select(x => x.Value);
     subAreaComboBox.SelectedIndex = 0;
 }
Beispiel #2
0
        public UpdateRequestPage(BlApi.IBl bl, BO.Client client, ListBox listBox, BO.GuestRequest guestRequest)
        {
            InitializeComponent();
            guest         = guestRequest;
            this.bl       = bl;
            this.clientID = client.Details.Id;
            this.Client   = client;
            this.listBox  = listBox;

            var enumPreferences = Enum.GetValues(typeof(BO.Preferences));

            #region  convert enums for Update
            typeComboBox.ItemsSource = MyDictionary.HostingTypes.Select(x => MyDictionary.TranslateEnumToString(x));
            areaComboBox.ItemsSource = MyDictionary.Locations.Select(x => MyDictionary.TranslateEnumToString(x));
            childrensAttractionsComboBox.ItemsSource = MyDictionary.Preferences.Select(x => MyDictionary.TranslateEnumToString(x));
            gardenComboBox.ItemsSource  = MyDictionary.Preferences.Select(x => MyDictionary.TranslateEnumToString(x));
            poolComboBox.ItemsSource    = MyDictionary.Preferences.Select(x => MyDictionary.TranslateEnumToString(x));
            jacuzziComboBox.ItemsSource = MyDictionary.Preferences.Select(x => MyDictionary.TranslateEnumToString(x));
            #endregion
            UpdateRequest.DataContext    = guest;
            adultsComoboBox.ItemsSource  = Numbers.ArrayNumbers;
            childrenComboBox.ItemsSource = Numbers.ArrayNumbers;
            subAreaComboBox.ItemsSource  = (XElement.Load(@"XML/CitiesList.xml").Elements().Select(x => x.Value));
        }