private void DeleteRequest_Click(object sender, RoutedEventArgs e) { MessageBoxResult mbr = MessageBox.Show("אתה בטוח שברצונך למחוק?", "הודעה", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No, MessageBoxOptions.RtlReading); if (mbr == MessageBoxResult.No) { return; } Button button = sender as Button; BO.GuestRequest guestRequest = (BO.GuestRequest)(button.DataContext); guestRequest.Status = BO.Request_Statut.CANCELLED; try { bl.UpdateGusetRequest(guestRequest); this.Client = bl.GetClient(Client.Details.Id); MainListBox.ItemsSource = Client.Requests; MainListBox.Items.Refresh(); } catch (MissingMemberException exp) { MessageBox.Show(exp.Message); } catch (InvalidOperationException exc) { MessageBox.Show(exc.Message); } }
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; }
public ViewGuestRequestWindow(BO.GuestRequest guest) { InitializeComponent(); this.guest = guest; ViewRequest.DataContext = this.guest; var enumPreferences = Enum.GetValues(typeof(BO.Preferences)); #region convert enums for Update areaComboBox.ItemsSource = Enum.GetValues(typeof(BO.Location)); childrensAttractionsComboBox.ItemsSource = enumPreferences; gardenComboBox.ItemsSource = enumPreferences; poolComboBox.ItemsSource = enumPreferences; jacuzziComboBox.ItemsSource = enumPreferences; typeComboBox.ItemsSource = Enum.GetValues(typeof(BO.Hosting_Type)); StatusComboBox.ItemsSource = Enum.GetValues(typeof(BO.Request_Statut)); #endregion }
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)); }