public AvilableUnits(BlApi.IBl bl, int _id, int guestRequestKey) { InitializeComponent(); this.bl = bl; request = bl.GetRequest(guestRequestKey); hostId = _id; numOfDays = (request.LeaveDate - request.EntryDate).Days; hostId = _id; lstUnits = bl.AvailableUnits(request.EntryDate, numOfDays).ToList(); lstUnits.RemoveAll(x => x.HostId != hostId); hostingUnitListView.ItemsSource = lstUnits; }
private void sendRequestButton_Click(object sender, RoutedEventArgs e) { try { request.CreateDate = DateTime.Now; int key = bl.AddRequest(request); lst.Add(bl.GetRequest(key)); lstView.Items.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { this.Close(); } }