Beispiel #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;
        }
Beispiel #2
0
        public Boolean checkEnteredData(bool x)
        {
            bool         ans       = true;
            ValidateData validator = new ValidateData();
            SQLQuery     mSQLQuery = new SQLQuery();

            if (!validator.verifyField(firstName.Text))
            {
                ans = false;
                firstNameError.Visibility = Visibility.Visible;
            }
            else
            {
                firstNameError.Visibility = Visibility.Hidden;
            }

            if (!validator.verifyField(lastName.Text))
            {
                ans = false;
                lastNameError.Visibility = Visibility.Visible;
            }
            else
            {
                lastNameError.Visibility = Visibility.Hidden;
            }

            if (!x && (!validator.checkNationalID(ID.Text) || mSQLQuery.getParentByID(Convert.ToInt64(ID.Text)).Rows.Count != 0))
            {
                ans = false;
                IDError.Visibility = Visibility.Visible;
            }
            else
            {
                IDError.Visibility = Visibility.Hidden;
            }

            if (!validator.checkMails(email.Text))
            {
                ans = false;
                emailError.Visibility = Visibility.Visible;
            }
            else
            {
                emailError.Visibility = Visibility.Hidden;
            }

            if (!validator.checkPhoneNum(phoneNumber.Text))
            {
                ans = false;
                phoneError.Visibility = Visibility.Visible;
            }
            else
            {
                phoneError.Visibility = Visibility.Hidden;
            }

            if (!validator.verifyField(address.Text))
            {
                ans = false;
                addressError.Visibility = Visibility.Visible;
            }
            else
            {
                addressError.Visibility = Visibility.Hidden;
            }

            if (!validator.checkCreditCardt(creditCard.Text))
            {
                ans = false;
                creditError.Visibility = Visibility.Visible;
            }
            else
            {
                creditError.Visibility = Visibility.Hidden;
            }

            if (mSQLQuery.checkForUsername(username.Text) && !x)
            {
                ans = false;
                usernameError.Visibility = Visibility.Visible;
            }
            else
            {
                usernameError.Visibility = Visibility.Hidden;
            }

            if (!validator.verifyField(password.Password))
            {
                ans = false;
                passwordError.Visibility = Visibility.Visible;
            }
            else
            {
                passwordError.Visibility = Visibility.Hidden;
            }

            return(ans);
        }
Beispiel #3
0
        public Boolean checkEnteredData()
        {
            bool         ans       = true;
            ValidateData validator = new ValidateData();
            SQLQuery     mSQLQuery = new SQLQuery();

            if (!validator.verifyField(firstName.Text) || firstName.Text.Equals("Enter First Name Here"))
            {
                ans = false;
                firstNameError.Visibility = Visibility.Visible;
            }
            else
            {
                firstNameError.Visibility = Visibility.Hidden;
            }

            if (!validator.verifyField(lastName.Text) || lastName.Text.Equals("Enter Last Name Here"))
            {
                ans = false;
                lastNameError.Visibility = Visibility.Visible;
            }
            else
            {
                lastNameError.Visibility = Visibility.Hidden;
            }

            if (!validator.checkNationalID(ID.Text) || mSQLQuery.getParentByID(Convert.ToInt64(ID.Text)).Rows.Count != 0)
            {
                ans = false;
                IDError.Visibility = Visibility.Visible;
            }
            else
            {
                IDError.Visibility = Visibility.Hidden;
            }

            if (!validator.checkMails(email.Text))
            {
                ans = false;
                emailError.Visibility = Visibility.Visible;
            }
            else
            {
                emailError.Visibility = Visibility.Hidden;
            }

            if (!validator.checkPhoneNum(phoneNumber.Text))
            {
                ans = false;
                phoneError.Visibility = Visibility.Visible;
            }
            else
            {
                phoneError.Visibility = Visibility.Hidden;
            }

            if (!validator.verifyField(address.Text) || address.Text.Equals("Enter address Here"))
            {
                ans = false;
                addressError.Visibility = Visibility.Visible;
            }
            else
            {
                addressError.Visibility = Visibility.Hidden;
            }

            return(ans);
        }