Example #1
0
        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);
            }
        }
Example #2
0
 private void UpdateGuestRequestButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         bl.UpdateGusetRequest(this.guest);
     }
     catch (MissingMemberException exp)
     {
         MessageBox.Show(exp.Message);
         return;
     }
     catch (ArgumentOutOfRangeException exp)
     {
         MessageBox.Show(exp.Message);
         return;
     }
     catch
     {
         MessageBox.Show("שגיאה לא ידועה");
         return;
     }
     MessageBox.Show("הבקשה עודכנה בהצלחה");
     this.Client = bl.GetClient(clientID);
     this.listBox.ItemsSource = Client.Requests;
     this.listBox.Items.Refresh();
     NavigationService.GoBack();
 }