parent
76563d37f9
commit
0cf477b63d
|
@ -1,9 +1,13 @@
|
|||
using System;
|
||||
using Dapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Data.SQLite;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GreatHomeChildcare.Models;
|
||||
|
||||
namespace GreatHomeChildcare
|
||||
{
|
||||
|
@ -21,6 +25,29 @@ namespace GreatHomeChildcare
|
|||
#region misc
|
||||
#endregion
|
||||
|
||||
/* Checks to see if this is the first time the application has run.
|
||||
* by counting the number of guardians in the guardian table.
|
||||
*/
|
||||
internal bool isFirstTimeRun()
|
||||
{
|
||||
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
|
||||
{
|
||||
string strQuery = "SELECT COUNT(*) FROM Guardians";
|
||||
int num_guardians = cnn.Query<int>(strQuery).SingleOrDefault();
|
||||
|
||||
if (num_guardians > 0)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: implement
|
||||
internal List<Child> GetChildrenByGuardianID(int guardian_id_in)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#region reports
|
||||
#endregion
|
||||
|
||||
|
|
Loading…
Reference in New Issue