Exemple #1
0
 //Aurelio Arango 3-25-14
 //This funtion creates a new Form in which the selected student needs to authenticate itself
 private void buildStudentLoginForm()
 {
     
     bool foundForm = false; 
     foreach (Form f in Application.OpenForms)
     {
         if (f.GetType() == typeof(StudentLoginForm))
         {
             f.Show();
             foundForm = true;
             this.Hide();
         }
     }
     if (!foundForm)
     { 
         StudentLoginForm loginForm = new StudentLoginForm();
         loginForm.Tag = this;
         loginForm.Show(this);
         this.Hide();
         
     }
 }
Exemple #2
0
        /*Aurelio Arango 3-25-14
        //This funtion creates a new Form in which the selected student needs to authenticate itself
        private void buildStudentLoginForm()
        {
            
            bool foundForm = false; 
            foreach (Form f in Application.OpenForms)
            {
                if (f.GetType() == typeof(StudentLoginForm))
                {
                    f.Show();
                    foundForm = true;
                    this.Hide();
                }
            }
            if (!foundForm)
            { 
                StudentLoginForm loginForm = new StudentLoginForm();
                loginForm.Tag = this;
                loginForm.Show(this);
                this.Hide();
                
            }
        }*/

        /*4-25-14
         * Jorge Torres and Aurelio Arango
         *Loading appropriate form based on student password enabled or disabled
         */
        private void buildStudentLoginForm(Boolean passWordEnabled)
        {

            bool foundForm = false;
            foreach (Form f in Application.OpenForms)
            {
                if (f.GetType() == typeof(StudentLoginForm) && passWordEnabled == true)
                {
                    f.Show();
                    foundForm = true;
                    this.Hide();
                }
                else if (f.GetType() == typeof(StudentForm) && passWordEnabled == false)
                {
                    f.Show();
                    foundForm = true;
                    this.Hide();
                }
            }

            if (!foundForm)
            {
                if (passWordEnabled)
                {
                    StudentLoginForm loginForm = new StudentLoginForm();
                    loginForm.Tag = this;
                    loginForm.Show(this);
                    this.Hide();
                }
                else
                {
                    StudentForm loginform = new StudentForm();
                    loginform.Tag = this;
                    loginform.Show(this);
                    this.Hide();
                }
            }
        }