public void LoadList(object list, TableDisplay tableDisplay) { try { QueryControl.LoadList(list, tableDisplay); } catch (Exception e) { } }
public void selected_query(Query query) { switch (query) { case Query.AllGuestRequest: QueryControl.LoadList(MainWindow.bl.GetAllGuestRequests(), new GuestRequestTableDisplay()); break; case Query.AllHostingUnit: QueryControl.LoadList(MainWindow.bl.GetAllHostingUnits(), new HostingUnitTableDisplay()); break; case Query.AllOrders: QueryControl.LoadList(MainWindow.bl.GetAllOrders(), new OrderTableDisplay()); break; case Query.GroupGuestRequestByArea: Dictionary <AreaCode, List <GuestRequest> > group = MainWindow.bl.getGuestRequestGroupedByArea(); QueryControl.LoadList(group.DictionaryToListItems <AreaCode, GuestRequest>(), new GuestRequestTableDisplay()); break; case Query.GroupHostingUnitByArea: Dictionary <AreaCode, List <HostingUnit> > group2 = MainWindow.bl.getHostingUnitGroupedByArea(); QueryControl.LoadList(group2.DictionaryToListItems <AreaCode, HostingUnit>(), new HostingUnitTableDisplay()); break; case Query.GroupGuestRequestByAmountPeople: Dictionary <int, List <GuestRequest> > group3 = MainWindow.bl.getGuestRequestGroupedByNumOfPeople(); QueryControl.LoadList(group3.DictionaryToListItems <int, GuestRequest>(), new GuestRequestTableDisplay()); break; case Query.GroupHostByNumUnits: Dictionary <int, List <Host> > group4 = MainWindow.bl.getHostGroupedByNumUnits(); QueryControl.LoadList(group4.DictionaryToListItems <int, Host>(), new HostTableDisplay()); break; default: break; } }