Пример #1
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;
        }