Пример #1
0
        private void dataGridViewTab1_CellDoubleClick_1(object sender, DataGridViewCellEventArgs e)
        {
            if (labelTab1Title.Text != "Archive")
            {
                rowIndexTab1        = dataGridViewTab1.CurrentRow.Index;
                labelTab1Title.Text = rowIndexTab1.ToString();
                {
                    //rename the title's of practice class page
                    labelTab2NameCourse.Text    = onGoingClassesList[rowIndexTab1].nameCourse;
                    labelTab2NameProfessor.Text = onGoingClassesList[rowIndexTab1].fullNameProfessor;
                    labelTab2NameTa.Text        = onGoingClassesList[rowIndexTab1].fullNameTA;

                    //make a list from practice that TA or professor uploaded
                    database_practiceclass db = new database_practiceclass();
                    thisPractisClass = new classPracticeClass(onGoingClassesList[rowIndexTab1].term,
                                                              onGoingClassesList[rowIndexTab1].year, onGoingClassesList[rowIndexTab1].groupNumber);
                    selectedClassPractice = new List <ShowPractice>();
                    selectedClassPractice = thisPractisClass.GetClassPracticeList();

                    //show the practice in it's GridView
                    dataGridViewTab2Practice.Rows.Clear();
                    if (selectedClassPractice.Count != 0)
                    {
                        dataGridViewTab2Practice.RowCount = selectedClassPractice.Count;
                        for (int i = 0; i < selectedClassPractice.Count; i++)
                        {
                            dataGridViewTab2Practice.Rows[i].Cells["Tab2NumberPractice"].Value = selectedClassPractice[i].number;
                            dataGridViewTab2Practice.Rows[i].Cells["Tab2PartPractice"].Value   = selectedClassPractice[i].part;
                            //dataGridViewTab2Practice.Rows[i].Cells["tab2GradePractice"].Value = selectedClassPractice[i].;
                            dataGridViewTab2Practice.Rows[i].Cells["tab2UploadPractice"].Value =
                                global::PracticeClass.Properties.Resources.Icon_feather_upload_2x;
                            dataGridViewTab2Practice.Rows[i].Cells["tab2DownloadPractice"].Value =
                                global::PracticeClass.Properties.Resources.Icon_feather_download_2x;
                        }
                    }

                    //make data grid view for quiz
                    selectedClassQuiz = thisPractisClass.GetClassQuizList();
                    dataGridViewTab2Quiz.Rows.Clear();
                    if (selectedClassPractice.Count != 0)
                    {
                        dataGridViewTab2Quiz.RowCount = selectedClassQuiz.Count;
                        for (int i = 0; i < selectedClassPractice.Count; i++)
                        {
                            dataGridViewTab2Quiz.Rows[i].Cells["Tab2NumberPractice"].Value = selectedClassQuiz[i].number;
                            dataGridViewTab2Quiz.Rows[i].Cells["Tab2PartPractice"].Value   = selectedClassQuiz[i].date;
                            // dataGridViewTab2Quiz.Rows[i].Cells["tab2UploadPractice"].Value = selectedClassQuiz[i].;
                        }
                    }

                    //go to practice class page
                    tabControl1.SelectTab(tabPage2);
                    iconHome.Visible = true;
                }
            }
        }
Пример #2
0
        private void goto_Student_Btn_Click(object sender, EventArgs e)
        {
            {
                //rename the title's of practice class page
                Tab7_nameCourseLable.Text = onGoingClassesList[rowIndexTab1].nameCourse;
                Tab7_ProfessorLable.Text  = onGoingClassesList[rowIndexTab1].fullNameProfessor;
                Tab7_TALable.Text         = onGoingClassesList[rowIndexTab1].fullNameTA;

                //make a list from practice that TA or professor uploaded
                database_practiceclass db = new database_practiceclass();
                thisPractisClass = new classPracticeClass(onGoingClassesList[rowIndexTab1].term,
                                                          onGoingClassesList[rowIndexTab1].year, onGoingClassesList[rowIndexTab1].groupNumber);

                selectedClassStudents = new List <ShowStudent>();
                selectedClassStudents = thisPractisClass.GetClassStudentList();


                //------------------------------------------------------------------------------------------------------------------------

                //show the students in it's GridView
                dataGridView_StudentList.Rows.Clear();
                if (selectedClassStudents.Count != 0)
                {
                    dataGridView_StudentList.RowCount = selectedClassStudents.Count;
                    for (int i = 0; i < selectedClassStudents.Count; i++)
                    {
                        dataGridView_StudentList.Rows[i].Cells["StudentID"].Value   = selectedClassStudents[i].id;
                        dataGridView_StudentList.Rows[i].Cells["StudentName"].Value = selectedClassStudents[i].fullName;
                    }
                }

                //go to practice class page
                tabControl1.SelectTab(tabPage7);
                iconHome.Visible = true;
            }
        }