コード例 #1
0
        public void load()
        {
            DataTable memberTable = query("SELECT * FROM member");
            foreach (DataRow row in memberTable.Rows)
            {
                Member member = new Member();
                member.name = row[0].ToString();
                members.Add(member);
            }

            DataTable courseTable = query("SELECT * FROM course");
            foreach (DataRow row in courseTable.Rows)
            {
                Course course = new Course();
                course.name = row[0].ToString();
                courses.Add(course);
            }

            DataTable languageTable = query("SELECT * FROM language");
            foreach (DataRow row in languageTable.Rows)
            {
                Language language = new Language();
                language.name = row[0].ToString();
                languages.Add(language);
            }
        }
コード例 #2
0
 public void addMember(String name)
 {
     Member member = new Member();
     member.name = name;
     member.id = saveMember(name);
     members.Add(member);
 }