Example #1
0
        public RecentStatusStare GetRecentStatusStare(string id)
        {
            string            sql    = "select TOP 10 문제푼시간,학생점수,교과목이름 from ps1,stuscore,unit,StuData where StuScore.교과목번호=unit.교과목번호 and stuscore.학생번호 = (select 학생번호 from Student where 아이디='" + id + "') group by 문제푼시간,학생점수,교과목이름 order by 문제푼시간 desc";
            RecentStatusStare recent = DBM.GetRecentStatusStareDB(sql);

            return(recent);
        }
Example #2
0
        internal RecentStatusStare GetRecentStatusStareDB(string sql)
        {
            string[] unitname = new string[10];
            int[]    score    = new int[10];
            string[] time     = new string[10];
            int      i        = 0;

            using (SqlCommand scom = new SqlCommand(sql, scon))
            {
                scom.Connection.Open();
                using (SqlDataReader reader = scom.ExecuteReader())
                {
                    if (reader == null)
                    {
                        scom.Connection.Close();
                        return(null);
                    }
                    while (reader.Read())
                    {
                        unitname[i] = reader["교과목이름"].ToString();
                        score[i]    = int.Parse(reader["학생점수"].ToString());
                        time[i]     = reader["문제푼시간"].ToString();
                        i++;
                    }
                    scom.Connection.Close();
                }
            }
            RecentStatusStare recent = new RecentStatusStare(unitname, score, time);

            return(recent);
        }