示例#1
0
        public void GuestFilter(object sender, RoutedEventArgs e)
        {
            string newOld = null;
            string text   = GuestZone.tbxSearch.Text;

            if (GuestZone.cbxNewOld.SelectedItem != null)
            {
                newOld = ((ComboBoxItem)GuestZone.cbxNewOld.SelectedItem).Content.ToString();
            }
            try
            {
                guestRequestsList = bL.GetAllGuestRequests(Item => Item.MailAddress == guestMail &&
                                                           (Item.PrivateName.Contains(text) || Item.FamilyName.Contains(text) || text == "Search")).ToList();

                if (newOld != null)
                {
                    guestRequestsList = guestRequestsList.OrderByDescending(item => item.RegistrationDate).ToList();
                    if (newOld == "הישנים יותר")
                    {
                        guestRequestsList.Reverse();
                    }
                }
                this.GuestZone.dataGrid.ItemsSource = guestRequestsList;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "לא נמצאו הזמנות", MessageBoxButton.OK,
                                MessageBoxImage.Error, MessageBoxResult.Cancel, MessageBoxOptions.RightAlign);
            }
        }
示例#2
0
 /// <summary>
 /// open the guestRequest details
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OrdersGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     guestRequest = bL.GetAllGuestRequests(item => item.GuestRequestKey == currentOrder.GuestRequestKey).FirstOrDefault();
     new AddGuestRequest(guestRequest).ShowDialog();
 }