diff --git a/QueueSys/SqliteDataAccess.cs b/QueueSys/SqliteDataAccess.cs index d133f32..4e6b772 100644 --- a/QueueSys/SqliteDataAccess.cs +++ b/QueueSys/SqliteDataAccess.cs @@ -12,9 +12,9 @@ namespace QueueSys { public class CustomerView { - public string customerName { get; } - public string status { get; } - public string timeElapsed { get; } + public string Customer { get; } + public string Status { get; } + public string TimeElapsed { get; } } public class EmployeeView @@ -28,7 +28,7 @@ namespace QueueSys public class SqliteDataAccess { - public static List LoadEmployeeView() + public List LoadEmployeeView() { //A using statement protects us as a failsafe: it guarantees the connection to the //database will be closed, even in event of an application or computer crash. @@ -41,18 +41,18 @@ namespace QueueSys } } - public static List LoadCustomerView() + public List LoadCustomerView() { using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString())) { - string strQuery = "SELECT customer_name,status FROM active_customers;"; + string strQuery = "SELECT customer_name as Customer,status_lookup.status as Status,Cast ((JulianDay('now') - JulianDay(start_time)) * 24 * 60 As Integer) as TimeElapsed FROM active_customers INNER JOIN status_lookup on active_customers.status_id=status_lookup.status_id ORDER BY active_customers.status_id"; var output = cnn.Query(strQuery, new DynamicParameters()); return output.ToList(); } } - public static void SaveCustomer(EmployeeView customer) + public void SaveCustomer(EmployeeView customer) { using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString())) { @@ -61,7 +61,7 @@ namespace QueueSys } } - public static void ArchiveCustomer(EmployeeView customer) + public void ArchiveCustomer(EmployeeView customer) { using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString())) {