Esempio n. 1
0
 /// <summary>
 /// Initalizes the form.
 /// Authors: Jacob Tan
 /// </summary>
 /// <param name="student">The user</param>
 /// <param name="homeRef"></param>
 /// <param name="courseName">The course name</param>
 public CourseForm(Student student, HomeForm homeRef, string courseName)
 {
     InitializeComponent();
     this.student       = student;
     this.parent        = homeRef;
     this.courseName    = courseName;
     addAnnoBtn.Visible = false;
 }
Esempio n. 2
0
 public CourseForm(Instructor instructor, HomeForm homeRef, string courseName)
 {
     InitializeComponent();
     this.instructor    = instructor;
     this.parent        = homeRef;
     this.courseName    = courseName;
     addAnnoBtn.Visible = true;
 }
Esempio n. 3
0
        /// <summary>
        /// Initializer.
        /// Authors: Eric Dong
        /// </summary>
        /// <param name="student">Student object that represents the user.</param>
        /// <param name="homeref"></param>
        public SettingsForm(Student student, HomeForm homeref)
        {
            InitializeComponent();
            this.student = student;
            this.homeref = homeref;

            this.appSizeComboBox.SelectedItem = null;
            String defaultSize = "";

            defaultSize += Settings.Default.ApplicationSize.Height + ", " + Settings.Default.ApplicationSize.Width;
            this.appSizeComboBox.SelectedText = defaultSize;
        }
 /// <summary>
 /// Initializer.
 /// Authors: Eric Dong
 /// </summary>
 /// <param name="student">Student object of the user</param>
 /// <param name="homeref">Parent</param>
 public userDataBaseSettings(Student student, HomeForm homeref)
 {
     InitializeComponent();
     this.student = student;
     this.homeref = homeref;
 }
Esempio n. 5
0
        /// <summary>
        /// Handles click to login, if login info is valid, opens homeform, else notifies user of failure with messagebox.
        /// Authors: Sepehr Mansouri, Jacob Tan
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLog_Click(object sender, EventArgs e)
        {
            if (hasEmptyFields() || !(studentRadio.Checked || InstructorRadio.Checked))
            {
                MessageBox.Show("Please fill in all the fields to proceed");
            }
            // Student login
            else if (studentRadio.Checked)
            {
                // Retrieves data from the database using Get()
                Student resStudent     = Student.getStudent(client, userLog.Text); // Database Results
                Student currentStudent = new Student()
                {
                    StudentNumber = userLog.Text,
                    Password      = passLog.Text
                };

                if (Student.areTheSameUsers(resStudent, currentStudent))
                {
                    // Passes the student info to the homepage
                    HomeForm home = new HomeForm(resStudent);
                    home.ShowDialog();

                    if (home.DialogResult == DialogResult.Cancel)
                    {
                        userLog.Clear();
                        passLog.Clear();
                        home.Close();
                        home.Dispose();
                    }
                }
                else
                {
                    Student.ShowErrorMessage();
                }
            }
            // Instructor login
            else
            {
                // Retrieves data from the database using Get()
                Instructor resInstructor     = Instructor.getInstructor(client, userLog.Text); // Database Results
                Instructor currentInstructor = new Instructor()
                {
                    InstructorNumber = userLog.Text,
                    Password         = passLog.Text
                };

                if (Instructor.areTheSameUsers(resInstructor, currentInstructor))
                {
                    // Passes the student info to the homepage
                    HomeForm home = new HomeForm(resInstructor);
                    home.ShowDialog();

                    if (home.DialogResult == DialogResult.Cancel)
                    {
                        userLog.Clear();
                        passLog.Clear();
                        home.Close();
                        home.Dispose();
                    }
                }
                else
                {
                    Instructor.ShowErrorMessage();
                }
            }
        }
Esempio n. 6
0
 public Dashboard(Instructor instructor, HomeForm homeRef)
 {
     InitializeComponent();
     this.instructor = instructor;
     this.parent     = homeRef;
 }
Esempio n. 7
0
 /// <summary>
 /// Initalizes the form.
 /// Authors: Jacob Tan
 /// </summary>
 /// <param name="student"></param>
 /// <param name="homeRef"></param>
 public Dashboard(Student student, HomeForm homeRef)
 {
     InitializeComponent();
     this.student = student;
     this.parent  = homeRef;
 }