Update query for customer view.

Add new report view class in prep to change employeeview class.
This commit is contained in:
kougyoku 2019-10-15 08:03:15 -07:00
parent 9c26d0519e
commit 74af82d70c

View File

@ -14,7 +14,18 @@ namespace QueueSys
{
public string Customer { get; }
public string Status { get; }
public string TimeElapsed { get; }
}
public class ReportView
{
public int id { get; }
public string customer_name { get; set; }
public int num_bags { get; set; }
public string employee { get; set; }
public int status { get; set; }
public string start_time { get; set; }
public string end_time { get; set; }
public string time_elapsed { get; set; }
}
public class EmployeeView
@ -45,7 +56,7 @@ namespace QueueSys
{
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
{
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";
string strQuery = "SELECT customer_name as Customer,status_lookup.status as Status 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<CustomerView>(strQuery, new DynamicParameters());
return output.ToList();