Ejemplo n.º 1
0
        private void ProjectsMnBtn_Click(object sender, EventArgs e)
        {
            YouAreHere(ProjectsMnBtn);

            CoursesList.Hide();
            SelectCourseBtn.Hide();
            SelectedCourseLabel.Hide();

            label11.Text = CoursesList.SelectedItems[0].Text;

            ProjectsList.Show();
            UploadGroupBox.Show();

            ProjectsList.Items.Clear();
            try
            {
                Team team         = Database.GetTeamOfStudent(user, SelectedCourse);
                var  listViewItem = new ListViewItem();

                foreach (KeyValuePair <Project, ProjectFile> pair in team.getProjectAssignmentsD())
                {
                    if (DateTime.Compare(pair.Key.getDueDate(), DateTime.Now) > 0)
                    {
                        listViewItem      = new ListViewItem();
                        listViewItem.Text = pair.Key.getProjectID();
                        listViewItem.SubItems.Add(pair.Key.getname());
                        if (pair.Value == null)
                        {
                            listViewItem.SubItems.Add("No");
                        }
                        else
                        {
                            listViewItem.SubItems.Add("Yes");
                        }
                        try
                        {
                            if (!(pair.Value.getGrade() < 0))
                            {
                                listViewItem.SubItems.Add(pair.Value.getGrade().ToString());
                            }
                            else
                            {
                                listViewItem.SubItems.Add("-");
                            }
                        }
                        catch (NullReferenceException ex)
                        {
                            listViewItem.SubItems.Add("-");
                        }
                        ProjectsList.Items.Add(listViewItem);
                    }
                }
            }
            catch (Exception msg)
            {
                MessageBox.Show("You have no team");
            }
        }
Ejemplo n.º 2
0
        public StudentForm()
        {
            InitializeComponent();

            //========================================================================
            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("Course", -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.Show();
            UploadGroupBox.Location = new Point(450, 12);
        }