예제 #1
0
파일: Hymn.cs 프로젝트: grosa82/LDSMeetings
 public List<Hymn> getAll()
 {
     List<Hymn> hymns = new List<Hymn>();
     foreach (List<string> data in database.retrieveData("SELECT id, name " +
         "FROM bakeappdb.lds_hymn  " +
         " order by name, id"))
     {
         Hymn hymn = new Hymn();
         hymn.Number = Convert.ToInt32(data[0]);
         hymn.Name = data[1];
         hymns.Add(hymn);
     }
     return hymns;
 }
예제 #2
0
        public List <Hymn> getAll()
        {
            List <Hymn> hymns = new List <Hymn>();

            foreach (List <string> data in database.retrieveData("SELECT id, name " +
                                                                 "FROM bakeappdb.lds_hymn  " +
                                                                 " order by name, id"))
            {
                Hymn hymn = new Hymn();
                hymn.Number = Convert.ToInt32(data[0]);
                hymn.Name   = data[1];
                hymns.Add(hymn);
            }
            return(hymns);
        }
예제 #3
0
파일: Hymn.cs 프로젝트: grosa82/LDSMeetings
 public List<Hymn> getHymns(string keyword)
 {
     keyword = "%" + keyword + "%";
     List<Hymn> hymns = new List<Hymn>();
     foreach (List<string> data in database.retrieveData("SELECT id, name " +
         "FROM bakeappdb.lds_hymn  " +
         "where name like @name " +
         "   or id like @id " +
         "order by name, id", keyword, keyword))
     {
         Hymn hymn = new Hymn();
         hymn.Number = Convert.ToInt32(data[0]);
         hymn.Name = data[1];
         hymns.Add(hymn);
     }
     return hymns;
 }
예제 #4
0
        public List <Hymn> getHymns(string keyword)
        {
            keyword = "%" + keyword + "%";
            List <Hymn> hymns = new List <Hymn>();

            foreach (List <string> data in database.retrieveData("SELECT id, name " +
                                                                 "FROM bakeappdb.lds_hymn  " +
                                                                 "where name like @name " +
                                                                 "   or id like @id " +
                                                                 "order by name, id", keyword, keyword))
            {
                Hymn hymn = new Hymn();
                hymn.Number = Convert.ToInt32(data[0]);
                hymn.Name   = data[1];
                hymns.Add(hymn);
            }
            return(hymns);
        }