Example #1
0
 public Statistics()
 {
     _Student = new Student();
     _Subject = new Subject();
     _DataBase = new StudentDataBase();
 }
Example #2
0
        public static DataTable GetTableSubjects()
        {
            DataTable table = new DataTable("Subject");
            DataColumn column; //столбцы
            DataRow row; //строки

            column = new DataColumn();
            column.DataType = typeof(System.String);
            column.ColumnName = "academicYear";
            table.Columns.Add(column);

            column = new DataColumn();
            column.DataType = typeof(System.String);
            column.ColumnName = "surname";
            table.Columns.Add(column);

            column = new DataColumn();
            column.DataType = typeof(System.String);
            column.ColumnName = "name";
            table.Columns.Add(column);

            column = new DataColumn();
            column.DataType = typeof(System.String);
            column.ColumnName = "patronymic";
            table.Columns.Add(column);

            column = new DataColumn();
            column.DataType = typeof(System.Double);
            column.ColumnName = "mark";
            table.Columns.Add(column);

            column = new DataColumn();
            column.DataType = typeof(System.Double);
            column.ColumnName = "percentageOfVisits";
            table.Columns.Add(column);

            column = new DataColumn();
            column.DataType = typeof(System.String);
            column.ColumnName = "surnameStudent";
            table.Columns.Add(column);

            string name = "Георгий";
            string surname = "Чернышев";
            string patronymic = "Алексеевич";
            string academicYear = "2013 - 2014";
            string surnameStudent = "Григорьев";

            Subject subject1 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject1.AddMark(5);
            subject1.AddpercentageOfVisits(100);

            name = "Георгий";
            surname = "Чернышев";
            patronymic = "Алексеевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Бирилло";

            Subject subject2 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject2.AddMark(5);
            subject2.AddpercentageOfVisits(100);

            name = "Георгий";
            surname = "Чернышев";
            patronymic = "Алексеевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Ключиков";

            Subject subject3 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject3.AddMark(5);
            subject3.AddpercentageOfVisits(100);

            name = "Георгий";
            surname = "Чернышев";
            patronymic = "Алексеевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Галактионов";

            Subject subject4 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject4.AddMark(5);
            subject4.AddpercentageOfVisits(100);

            name = "Георгий";
            surname = "Чернышев";
            patronymic = "Алексеевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Гoловань";

            Subject subject5 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject5.AddMark(5);
            subject5.AddpercentageOfVisits(100);

            name = "Георгий";
            surname = "Чернышев";
            patronymic = "Алексеевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Лабузов";

            Subject subject7 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject7.AddMark(4);
            subject7.AddpercentageOfVisits(100);

            name = "Георгий";
            surname = "Чернышев";
            patronymic = "Алексеевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Миронович";

            Subject subject8 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject8.AddMark(5);
            subject8.AddpercentageOfVisits(100);

            name = "Георгий";
            surname = "Чернышев";
            patronymic = "Алексеевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Пак";

            Subject subject9 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject9.AddMark(5);
            subject9.AddpercentageOfVisits(100);

            name = "Никита";
            surname = "Ловягин";
            patronymic = "Юрьевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Артемьева";

            Subject subject6 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject6.AddMark(5);
            subject6.AddpercentageOfVisits(100);

            name = "Никита";
            surname = "Ловягин";
            patronymic = "Юрьевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Багрецов";

            Subject subject10 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject10.AddMark(5);
            subject10.AddpercentageOfVisits(100);

            name = "Никита";
            surname = "Ловягин";
            patronymic = "Юрьевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Веревкина";

            Subject subject11 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject11.AddMark(5);
            subject11.AddpercentageOfVisits(100);

            name = "Никита";
            surname = "Ловягин";
            patronymic = "Юрьевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Зернов";

            Subject subject12 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject12.AddMark(5);
            subject12.AddpercentageOfVisits(100);

            name = "Никита";
            surname = "Ловягин";
            patronymic = "Юрьевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Искрич";

            Subject subject13 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject13.AddMark(5);
            subject13.AddpercentageOfVisits(100);

            name = "Никита";
            surname = "Ловягин";
            patronymic = "Юрьевич";
            academicYear = "2013 - 2014";
            surnameStudent = "Шиндарев";

            Subject subject14 = new Subject(academicYear, name, surname, patronymic, surnameStudent);
            subject14.AddMark(4);
            subject14.AddpercentageOfVisits(100);

            List<Subject> subjects = new List<Subject>() { subject1, subject2, subject3, subject4, subject5, subject7, subject8, subject9, subject6, subject10, subject11, subject12, subject13,subject14  };

            for (int i = 0; i < subjects.Count; i++)
            {
                row = table.NewRow();
                row["academicYear"] = subjects[i].academicYear;
                row["surname"] = subjects[i].surnameLecturer;
                row["name"] = subjects[i].nameLecturer;
                row["patronymic"] = subjects[i].patronymicLecturer;
                row["mark"] = subjects[i].mark;
                row["percentageOfVisits"] = subjects[i].percentageOfVisits;
                row["surnameStudent"] = subjects[i].surnameStudent;
                table.Rows.Add(row);
            }
            return table;
        }