Add query to get all children from DB from admin form

This commit is contained in:
kougyokugentou 2021-01-18 20:43:26 -08:00
parent c037591451
commit 02b4a958f3
1 changed files with 14 additions and 0 deletions

View File

@ -20,6 +20,20 @@ namespace GreatHomeChildcare
#region student
// ***************** Create *****************
// ***************** Read *******************
/* Gets all children from the sqlite database.
* INPUT: void
* OUTPUT: list of Child objects
*/
internal List<Child> GetAllChildren()
{
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
{
string strQuery = "SELECT * FROM Children";
var output = cnn.Query<Child>(strQuery);
return output.ToList();
}
}
// ***************** Update *****************
// ***************** Delete *****************
#endregion