public void loadChildren() { childRow.Clear(); children.Children.Clear(); SQLQuery mSQLQuery = new SQLQuery(); childList = mSQLQuery.childToLinkedList(mSQLQuery.getChildByParentID(GlobalVariables.globalParent.id)); LinkedList <Child> notPending = new LinkedList <Child>(); foreach (Child c in childList) { if (c.pending == 1) { notPending.AddLast(c); } else { c.lastName = GlobalVariables.globalParent.firstName; } } foreach (Child c in notPending) { childList.Remove(c); } showPendingChildren(); }
private void editDatabase_Click(object sender, RoutedEventArgs e) { staffs1.Children.Clear(); parents1.Children.Clear(); children1.Children.Clear(); rooms.Children.Clear(); childRow.Clear(); staffRow.Clear(); parentRow.Clear(); roomRow.Clear(); SQLQuery mSQLQuery = new SQLQuery(); childList = mSQLQuery.childToLinkedList(mSQLQuery.getNotPendingChild()); parentList = mSQLQuery.parentToLinkedList(mSQLQuery.getNotPendingParent()); staffList = mSQLQuery.staffToLinkedList(mSQLQuery.getNotPendingStaff()); roomList = mSQLQuery.roomToLinkedList(mSQLQuery.getAllRooms()); showPendingStaff(staffs1); showPendingChildren(children1); showPendingParent(parents1); showAllRoomsAndChildren(rooms); roomPanel.Visibility = Visibility.Hidden; this.AdminFeedback.Visibility = Visibility.Hidden; this.pendingRequestsPanel.Visibility = Visibility.Hidden; this.profilePanel.Visibility = Visibility.Hidden; this.editDatabasePanel.Visibility = Visibility.Visible; featuresPanel.Visibility = Visibility.Hidden; }
private void name_MouseDown(object sender, MouseButtonEventArgs e) { if (idx == 3) { aWindow.children2.Visibility = Visibility.Visible; aWindow.room5.Visibility = Visibility.Visible; aWindow.roomScrollerView.Visibility = Visibility.Hidden; aWindow.roomTab1.IsSelected = false; aWindow.children2.Children.Clear(); SQLQuery mSQLQuery = new SQLQuery(); child = mSQLQuery.childToLinkedList(mSQLQuery.getChildByRoomID(mRoom.id)); LinkedList <Staff> currStaff = mSQLQuery.staffToLinkedList(mSQLQuery.getStaffByID(mRoom.staffID)); if (currStaff.Count == 0) { aWindow.childCount.Content = "No Staff"; } else { aWindow.childCount.Content = currStaff.ElementAt(0).firstName; } aWindow.childList = child; aWindow.roomName.Content = "Room " + Convert.ToString(mRoom.number); aWindow.roomBack.Visibility = Visibility.Visible; aWindow.showPendingChildren(aWindow.children2); } }
private void pendingRequests_Click(object sender, RoutedEventArgs e) { staffs.Children.Clear(); parents.Children.Clear(); children.Children.Clear(); childRow.Clear(); parentRow.Clear(); staffRow.Clear(); SQLQuery mSQLQuery = new SQLQuery(); childList = mSQLQuery.childToLinkedList(mSQLQuery.getPendingChild()); parentList = mSQLQuery.parentToLinkedList(mSQLQuery.getPendingParent()); staffList = mSQLQuery.staffToLinkedList(mSQLQuery.getPendingStaff()); LinkedList <Child> notPending = new LinkedList <Child>(); foreach (Child c in childList) { DataTable dt = mSQLQuery.getParentByID(c.parentID); if (Convert.ToInt32(dt.Rows[0]["parentIsPending"]) == 1) { notPending.AddLast(c); } else { c.lastName = dt.Rows[0]["parentFirstName"].ToString(); } } foreach (Child c in notPending) { childList.Remove(c); } showPendingStaff(staffs); showPendingChildren(children); showPendingParent(parents); this.pendingRequestsPanel.Visibility = Visibility.Visible; this.profilePanel.Visibility = Visibility.Hidden; this.AdminFeedback.Visibility = Visibility.Hidden; this.editDatabasePanel.Visibility = Visibility.Hidden; roomPanel.Visibility = Visibility.Hidden; this.featuresPanel.Visibility = Visibility.Hidden; }
private void roomButton_Click(object sender, RoutedEventArgs e) { //hide all other windows SQLQuery mSQLQuery = new SQLQuery(); mRoom = mSQLQuery.roomToLinkedList(mSQLQuery.getRoomByStaffID(GlobalVariables.globalStaff.id)).ElementAt(0); roomName.Content = "Room" + " " + Convert.ToString(mRoom.number); childRow.Clear(); children.Children.Clear(); childList = mSQLQuery.childToLinkedList(mSQLQuery.getChildByRoomID(mRoom.id)); showPendingChildren(); this.profile.Visibility = Visibility.Hidden; this.feedbackPanel.Visibility = Visibility.Hidden; //show room grid this.room.Visibility = Visibility.Visible; }