Example #1
0
        public RowTemplate(int idx, int previousForm, int cIdx, int pIdx, int sIdx, LinkedList <Child> child, LinkedList <Parent> parent, LinkedList <Staff> staff, Grid super, adminWindow aWindow, parentWindow pWindow, staffWindow sWindow)
        {
            InitializeComponent();
            this.idx          = idx;
            this.child        = child;
            this.parent       = parent;
            this.staff        = staff;
            this.previousForm = previousForm;
            this.super        = super;
            this.aWindow      = aWindow;
            this.pWindow      = pWindow;
            this.sWindow      = sWindow;
            this.cIdx         = cIdx;
            this.pIdx         = pIdx;
            this.sIdx         = sIdx;

            initialize();
        }
Example #2
0
        private void loginButton_Click(object sender, RoutedEventArgs e)
        {
            SQLQuery mSqlQuery = new SQLQuery();

            if (!mSqlQuery.checkForUsername(username.Text))
            {
                usernameError.Visibility = Visibility.Visible;
                passwordError.Visibility = Visibility.Visible;
            }
            else if (!mSqlQuery.serachForUser(username.Text, password.Password))
            {
                usernameError.Visibility = Visibility.Hidden;
                passwordError.Visibility = Visibility.Visible;
            }
            else
            {
                usernameError.Visibility = Visibility.Hidden;
                passwordError.Visibility = Visibility.Hidden;

                if (GlobalVariables.globalType.Equals("Staff"))
                {
                    //open staff form

                    staffWindow mStaffWindow = new staffWindow();

                    mStaffWindow.Show();
                }
                else if (GlobalVariables.globalType.Equals("Admin"))
                {
                    //open admin form

                    adminWindow adminForm = new adminWindow();
                    adminForm.Show();
                }
                else if (GlobalVariables.globalType.Equals("Parent"))
                {
                    //open parent form
                    parentWindow mParentWindow = new parentWindow();
                    mParentWindow.Show();
                }
                this.Close();
            }
        }
Example #3
0
        private void loginButton_Click(object sender, RoutedEventArgs e)
        {
            SQLQuery mSqlQuery = new SQLQuery();

            if (mSqlQuery.checkForUsername(username.Text) == false)
            {
                usernameError.Visibility = Visibility.Visible;
                passwordError.Visibility = Visibility.Visible;
            }
            else if (!mSqlQuery.serachForUser(username.Text, password.Password) == false)
            {
                usernameError.Visibility = Visibility.Hidden;
                passwordError.Visibility = Visibility.Visible;
            }
            else
            {
                usernameError.Visibility = Visibility.Hidden;
                passwordError.Visibility = Visibility.Hidden;

                MessageBox.Show("Hello, " + username.Text + "!", "Logged In Successfully", MessageBoxButton.OK, MessageBoxImage.None);

                if (GlobalVariables.globalType.Equals("Staff"))
                {
                    //open staff form
                    staffWindow mStaffWindow = new staffWindow();
                    mStaffWindow.Show();
                }
                else if (GlobalVariables.globalType.Equals("Admin"))
                {
                    //open admin form
                    adminWindow adminForm = new adminWindow();
                    adminForm.Show();
                }
                else if (GlobalVariables.globalType.Equals("Parent"))
                {
                    //open parent form
                    parentWindow mParentWindow = new parentWindow();
                    mParentWindow.Show();
                }
                this.Close();
            }
        }