Ejemplo n.º 1
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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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;
 }
Ejemplo n.º 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);
        }