Exemplo n.º 1
0
        private void AButton_Click(object sender, EventArgs e)
        {
            if (state == 0)
            {
                Form3 advf = new Form3(Stud, Me, Crs, 2);
                advf.Show();
                this.Close();
            }

            if (state == 3)
            {
                Form3 dflt = new Form3(Stud, Me, Crs, 0);
                dflt.Show();
                this.Close();
            }
            if (state == 2)
            {
                Form3 dflt = new Form3(Stud, Me, Crs, 0);
                dflt.Show();
                this.Close();

            }
        }
Exemplo n.º 2
0
 private void Sbutton_Click(object sender, EventArgs e)
 {
     if (state == 0)
     {
         Form3 f = new Form3(Stud, Me, Crs, 1);
         f.Show();
         this.Close();
     }
     if (state == 1)
     {
         Form3 f = new Form3(Stud, Me, Crs, 0);
         f.Show();
         this.Close();
     }
     if (state == 2)
     {
         Form3 f = new Form3(Stud, MyStudents[dataGridView1.SelectedRows[0].Index],Me, Crs,3);
         f.Show();
         this.Close();
     }
 }
Exemplo n.º 3
0
        private void Sbutton_Click(object sender, EventArgs e)
        {
            if (FormState == FacFormState.allcourses)
            {
                Form3 f = new Form3(Stud, Me, Crs, 1);
                f.Show();
                this.Close();
            }
            if (FormState == FacFormState.mycourses)
            {
                Form3 f = new Form3(Stud, Me, Crs, 0);
                f.Show();
                this.Close();
            }
            if (FormState == FacFormState.myadvisees)
            {
                Form3 f = new Form3(Stud, MyStudents[dataGridView1.SelectedRows[0].Index],Me, Crs,0);
                f.Show();
                this.Close();
            }

            if (FormState == FacFormState.studentsched)
            {
                little.ShowConflicts();
            }
        }
Exemplo n.º 4
0
 private void RareButton_Click(object sender, EventArgs e)
 {
     Form3 f = new Form3(Stud, MyStudents[dataGridView1.SelectedRows[0].Index],
         Me, Crs, 1);
     f.Show();
     this.Close();
 }
Exemplo n.º 5
0
        private void AButton_Click(object sender, EventArgs e)
        {
            if (FormState == FacFormState.allcourses)
            {
                Form3 advf = new Form3(Stud, Me, Crs, 2);
                advf.Show();
                this.Close();
            }

            if ((FormState == FacFormState.studentsched) || (FormState == FacFormState.studentcurrent))
            {
                Form3 dflt = new Form3(Stud, Me, Crs, 2);
                dflt.Show();
                this.Close();
            }
            if (FormState == FacFormState.myadvisees)
            {
                Form3 dflt = new Form3(Stud, Me, Crs, 0);
                dflt.Show();
                this.Close();
            }

            if (FormState == FacFormState.myfutstudents)
            {
                Form3 f = new Form3(Stud, Me, Crs, 1);
                f.Show();
                this.Close();
            }

            if (FormState == FacFormState.mycourses)
            {
                Form3 futstd = new Form3(Stud, Me, Crs, 4);
                futstd.Show();
                this.Close();
            }
        }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool success = false;
            foreach (UserAdmin a in Admins)
                if (textBox1.Text == a.UserName)
                {
                    if (a.isPassword(textBox2.Text))
                    {

                        //launch admin form
                        //but for now:

                        Text = "Welcome " + a.UserName + ". " ;

                        AdminForm adm = new AdminForm(Faculty, Students, Courses, a);
                        adm.Show();

                        textBox1.Text = textBox2.Text = "";
                        //end form.
                    }

                    else
                    {
                        textBox2.Text = "";
                        label3.Show();
                        success = true;
                    } //tell user login failed.
                }

            foreach (UserFaculty f in Faculty)
                if (textBox1.Text == f.UserName)
                {
                    if (f.isPassword(textBox2.Text))
                    {

                        //launch faculty form
                        Text = "Welcome " + f.UserName + ". ";

                        Form3 formm = new Form3(Students,f,Courses,0);
                        formm.Show();
                        //this.Close();
                        textBox1.Text = textBox2.Text = "";

                        success = true;
                    }

                    else
                    {
                        textBox2.Text = "";
                        label3.Show();
                    } //tell user login failed.
                }

            foreach (UserStudent s in Students)
                if (textBox1.Text == s.UserName)
                {
                    if (s.isPassword(textBox2.Text))
                    {

                        //launch student form
                        Text = "Welcome " + s.UserName + ". ";
                        Form2 SF = new Form2(Courses, s, 0);
                        SF.Show();
                        textBox1.Text = textBox2.Text = "";
                        //this.Close();
                        success = true;
                    }

                    else
                    {
                        textBox2.Text = "";
                        label3.Show();
                    } //tell user login failed.
                }
            if (!success)
            {
                textBox2.Text = "";
                label3.Show();
            }
        }