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; }
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); }
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; }
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); }