Ejemplo n.º 1
0
        private void WatchOrdersButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Orders WindOrder = new Orders();
                WindOrder.CurrentHostingUnit = HostingUnit;
                guestRequestsList            = bL.GetAllGuestRequests(Item => Item.Area == HostingUnit.Area &&
                                                                      Item.Type == HostingUnit.HostingUnitType && Item.Status == Enums.GuestRequestStatus.Active.ToString() &&
                                                                      bL.ifAvailable(HostingUnit, Item.EntryDate, Item.ReleaseDate) != null);
                foreach (var item in guestRequestsList)
                {
                    creatOrder(item, HostingUnit);
                }

                ordersList = bL.getAllOrders(Item => Item.HostingUnitKey == HostingUnit.HostingUnitKey);
                if (ordersList.Count != 0)
                {
                    WindOrder.OrdersGrid.ItemsSource = ordersList;
                }
                WindOrder.ShowDialog();
                HostingUnitFilter(this, new RoutedEventArgs());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }