示例#1
0
        public FormStudent(string reg_num, FormLogin login)
        {
            InitializeComponent();

            this.login = login;
            //Courses List: A list that displays professor's courses
            CoursesList.Bounds        = new Rectangle(new Point(450, 50), new Size(275, 400));
            CoursesList.View          = View.Details;
            CoursesList.FullRowSelect = true;
            CoursesList.GridLines     = true;
            CoursesList.Sorting       = SortOrder.Ascending;
            CoursesList.Columns.Add("Courses", -2, HorizontalAlignment.Center);
            CoursesList.Columns.Add("ID", -2, HorizontalAlignment.Center);

            currentUser = Database.GetUser("student", reg_num);
            user        = (Student)currentUser;

            Dictionary <string, string> Courses = Database.getAllCourses();

            foreach (KeyValuePair <string, string> course in Courses)
            {
                var row = new String[]
                {
                    course.Value
                    , course.Key
                };
                var listViewItem = new ListViewItem(row);
                CoursesList.Items.Add(listViewItem);
            }
            SelectedCourseLabel.Location = new Point(475, 20);
            SelectCourseBtn.Location     = new Point(551, 458);
            //==============================================================================


            //========================================================================
            ProjectsList.Bounds        = new Rectangle(new Point(150, 12), new Size(275, 500));
            ProjectsList.View          = View.Details;
            ProjectsList.FullRowSelect = true;
            ProjectsList.GridLines     = true;
            ProjectsList.Sorting       = SortOrder.Ascending;
            ProjectsList.Columns.Add("Project ID", -2, HorizontalAlignment.Left);
            ProjectsList.Columns.Add("Project", -2, HorizontalAlignment.Left);
            ProjectsList.Columns.Add("Sent", -2, HorizontalAlignment.Left);
            ProjectsList.Columns.Add("Grade", -2, HorizontalAlignment.Left);
            //==============================================================

            ProjectsList.Hide();
            UploadGroupBox.Hide();

            CoursesList.Show();
            SelectCourseBtn.Show();
            SelectCourseMnBtn.BackColor = Color.FromArgb(66, 131, 178);

            UploadGroupBox.Location = new Point(450, 12);
            UploadBtn.Enabled       = false;
            ProjectsMnBtn.Enabled   = false;
            BrowseBtn.Enabled       = false;

            UploadGroupBox.Paint += Paint;
        }
示例#2
0
        private void SelectCourseMnBtn_Click(object sender, EventArgs e)
        {
            YouAreHere(SelectCourseMnBtn);

            CoursesList.Show();
            SelectCourseBtn.Show();
            SelectedCourseLabel.Show();

            ProjectsList.Hide();
            UploadGroupBox.Hide();
            BrowseBtn.Enabled = false;
        }
示例#3
0
        private void ChooseCourseMnBtn_Click(object sender, EventArgs e)
        {
            YouAreHere(ChooseCourseMnBtn);
            ProjectGroupBox.Hide();
            ProjectList.Hide();
            GradeList.Hide();
            GradeGroupBox.Hide();
            TeamGroupBox.Hide();
            TeamList.Hide();
            SelectedCourseLabel.Show();

            CoursesList.Show();
            SelectCourseBtn.Show();
        }
 private void EditDelCoursesMnBtn_Click(object sender, EventArgs e)
 {
     UserGroupBox.Hide();
     AssignMsgLabel.Hide();
     AssignCourseBtn.Hide();
     CancelUsersBtn.Hide();
     CancelCoursesBtn.Hide();
     ClearBoxes();
     UsersList.Enabled        = true;
     CoursesList.Enabled      = true;
     CreateEditCourseBtn.Text = "Submit";
     UsersList.Show();
     CoursesList.Show();
     CourseGroupBox.Show();
     ChangeMsgLabel("Edit", "Courses");
     this.CourseGroupBox.Location = new Point(410, 12);
     this.UsersList.Location      = new Point(635, 12);
 }
        private void AssignCoursesMenuBtn_Click(object sender, EventArgs e)
        {
            UsersList.Enabled   = true;
            CoursesList.Enabled = true;
            UserGroupBox.Hide();
            CourseGroupBox.Hide();
            AssignMsgLabel.Show();
            AssignCourseBtn.Show();
            AssignMsgLabel.Text = "";
            CoursesList.Show();
            UsersList.Show();
            ClearBoxes();

            //clear the array from previous entries
            assignments[0] = "";
            assignments[1] = "";
            //=====================

            CancelUsersBtn.Hide();
            CancelCoursesBtn.Hide();
            UsersList.Location       = new Point(635, 12);
            AssignMsgLabel.Location  = new Point(407, 50);
            AssignCourseBtn.Location = new Point(467, 100);
        }
示例#6
0
        public FormProfessor(string reg_num, FormLogin login)
        {
            InitializeComponent();

            this.login = login;

            ChooseCourseMnBtn.BackColor  = Color.FromArgb(100, 10, 10, 10);
            ModifyProjectMnBtn.BackColor = Color.FromArgb(100, 10, 10, 10);
            ModifyTeamMnBtn.BackColor    = Color.FromArgb(100, 10, 10, 10);
            GradeProjectsMnBtn.BackColor = Color.FromArgb(100, 10, 10, 10);
            label1.BackColor             = Color.FromArgb(100, 10, 10, 10);
            LogoutBtn.BackColor          = Color.FromArgb(100, 10, 10, 10);

            TeamGroupBox.Paint    += Paint;
            ProjectGroupBox.Paint += Paint;
            GradeGroupBox.Paint   += Paint;

            currentUser = Database.GetUser(UserTypes.PROFESSOR, reg_num);


            user = (Professor)currentUser;
            //Courses List: A list that displays professor's courses
            CoursesList.Bounds        = new Rectangle(new Point(450, 50), new Size(275, 400));
            CoursesList.View          = View.Details;
            CoursesList.FullRowSelect = true;
            CoursesList.GridLines     = true;
            CoursesList.Sorting       = SortOrder.Ascending;
            CoursesList.Columns.Add("Cource name", -2, HorizontalAlignment.Center);
            CoursesList.Columns.Add("ID", -2, HorizontalAlignment.Center);



            foreach (Course course in user.getCourseList())
            {
                var listViewItem = new ListViewItem(course.getCourseName());
                listViewItem.SubItems.Add(course.getCourseID());
                CoursesList.Items.Add(listViewItem);
            }


            SelectedCourseLabel.Location = new Point(475, 20);
            SelectCourseBtn.Location     = new Point(551, 458);
            //==============================================================================


            //Project List:A list that displays the professor's projects
            ProjectList.Bounds        = new Rectangle(new Point(150, 12), new Size(250, 500));
            ProjectList.View          = View.Details;
            ProjectList.FullRowSelect = true;
            ProjectList.GridLines     = true;
            ProjectList.Sorting       = SortOrder.Ascending;
            ProjectList.Columns.Add("ID", -2, HorizontalAlignment.Left);
            ProjectList.Columns.Add("Project Name", -2, HorizontalAlignment.Left);
            ProjectList.Columns.Add("Max Grade", -2, HorizontalAlignment.Left);
            //==========================================================================


            //Students List: A list that displays each teams infos
            TeamList.Bounds        = new Rectangle(new Point(150, 12), new Size(375, 500));
            TeamList.View          = View.Details;
            TeamList.FullRowSelect = true;
            TeamList.GridLines     = true;
            TeamList.Sorting       = SortOrder.Ascending;
            TeamList.Columns.Add("Team", -2, HorizontalAlignment.Left);
            TeamList.Columns.Add("Student 1", -2, HorizontalAlignment.Left);
            TeamList.Columns.Add("Student 2", -2, HorizontalAlignment.Left);
            TeamList.Columns.Add("Student 3", -2, HorizontalAlignment.Left);
            TeamList.Columns.Add("Student 4", -2, HorizontalAlignment.Left);
            TeamList.Columns.Add("Student 5", -2, HorizontalAlignment.Left);
            //=============================================================================


            //Grade List: A list that displays the team with its project an the grade
            GradeList.Bounds        = new Rectangle(new Point(150, 12), new Size(275, 500));
            GradeList.View          = View.Details;
            GradeList.FullRowSelect = true;
            GradeList.GridLines     = true;
            GradeList.Sorting       = SortOrder.Ascending;

            GradeList.Columns.Add("Team", -2, HorizontalAlignment.Left);
            GradeList.Columns.Add("Project ID", -2, HorizontalAlignment.Left);
            GradeList.Columns.Add("Project name", -2, HorizontalAlignment.Left);
            GradeList.Columns.Add("Project Uploaded", -2, HorizontalAlignment.Left);
            GradeList.Columns.Add("Grade", -2, HorizontalAlignment.Left);
            //==============================================================================



            //Teams Right Click menu creation
            ToolStripMenuItem TeamRightClickMenuEdit   = new ToolStripMenuItem("Edit");
            ToolStripMenuItem TeamRightClickMenuDelete = new ToolStripMenuItem("Delete");

            TeamRightClickMenuDelete.Click += new EventHandler(TeamDelete_RightClick);
            TeamRightClickMenuEdit.Click   += new EventHandler(TeamEdit_RightClick);
            TeamRightClickMenu.Items.AddRange(new ToolStripItem[] { TeamRightClickMenuEdit, TeamRightClickMenuDelete });
            //==========================================================================================================

            //Projects Right Click menu creation
            ToolStripMenuItem ProjectRightClickMenuEdit   = new ToolStripMenuItem("Edit");
            ToolStripMenuItem ProjectRightClickMenuDelete = new ToolStripMenuItem("Delete");

            ProjectRightClickMenuDelete.Click += new EventHandler(ProjectDelete_RightClick);
            ProjectRightClickMenuEdit.Click   += new EventHandler(ProjectEdit_RightClick);
            ProjectRightClickMenu.Items.AddRange(new ToolStripItem[] { ProjectRightClickMenuEdit, ProjectRightClickMenuDelete });
            //===================================================================================================================



            CourseHolderLabel.BackColor = Color.FromArgb(100, 10, 10, 10);



            TeamGroupBox.Text    = "";
            ProjectGroupBox.Text = "";
            GradeGroupBox.Text   = "";

            TeamGroupBox.Bounds = new Rectangle(new Point(550, 12), new Size(380, 355));

            CoursesList.Show();
            SelectCourseBtn.Show();
            ChooseCourseMnBtn.BackColor = Color.Black;

            TeamGroupBox.Hide();
            TeamList.Hide();
            GradeList.Hide();
            GradeGroupBox.Hide();
            ProjectGroupBox.Hide();
            ProjectList.Hide();


            ModifyProjectMnBtn.Enabled = false;
            ModifyTeamMnBtn.Enabled    = false;
            GradeProjectsMnBtn.Enabled = false;
        }