Beispiel #1
0
        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;
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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;
        }