コード例 #1
0
        int StudentCompare(BigDataStudents st1, BigDataStudents st2)
        {
            if (st1.Course > st2.Course)
            {
                return(1);
            }
            if (st1.Course < st2.Course)
            {
                return(-1);
            }

            return(0);
        }
コード例 #2
0
        public void CreateList()
        {
            sr_ = new StreamReader(path_);

            while (!sr_.EndOfStream)
            {
                try
                {
                    string[] s = sr_.ReadLine().Split(';');

                    bigDataStudents_ = new BigDataStudents(
                        s[0], s[1], s[2], s[3], s[4],
                        int.Parse(s[5]),
                        Convert.ToInt32(s[6]),
                        int.Parse(s[7]), s[8]);

                    list_.Add(bigDataStudents_);

                    if (bigDataStudents_.Course < 5)
                    {
                        bakalav_++;
                    }
                    else
                    {
                        magistr_++;
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }

            list_.Sort(StudentCompare);

            sr_.Close();
        }