Fix VS Griping.

Fix loadCustomerView
This commit is contained in:
kougyoku 2019-10-10 10:36:32 -07:00
parent 2a8702e1a9
commit ec0b1a00ae
1 changed files with 9 additions and 9 deletions

View File

@ -10,14 +10,14 @@ using System.Threading.Tasks;
namespace QueueSys namespace QueueSys
{ {
public class customerView public class CustomerView
{ {
public string customerName { get; } public string customerName { get; }
public string status { get; } public string status { get; }
public string timeElapsed { get; } public string timeElapsed { get; }
} }
public class employeeView public class EmployeeView
{ {
public int id { get; } public int id { get; }
public string customer_name { get; set; } public string customer_name { get; set; }
@ -28,7 +28,7 @@ namespace QueueSys
public class SqliteDataAccess public class SqliteDataAccess
{ {
public static List<employeeView> loadEmployeeView() public static List<EmployeeView> LoadEmployeeView()
{ {
string strQuery = "SELECT id,customer_name,num_bags,employee,status FROM active_customers;"; string strQuery = "SELECT id,customer_name,num_bags,employee,status FROM active_customers;";
@ -36,23 +36,23 @@ namespace QueueSys
//database will be closed, even in event of an application or computer crash. //database will be closed, even in event of an application or computer crash.
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString())) using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
{ {
var output = cnn.Query<employeeView>(strQuery, new DynamicParameters()); var output = cnn.Query<EmployeeView>(strQuery, new DynamicParameters());
return output.ToList(); return output.ToList();
} }
} }
public static List<customerView> loadCustomerView() public static List<CustomerView> LoadCustomerView()
{ {
string strQuery = "SELECT customer_name,status FROM active_customers;";
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString())) using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
{ {
var output = cnn.Query<employeeView>(strQuery, new DynamicParameters()); string strQuery = "SELECT customer_name,status FROM active_customers;";
var output = cnn.Query<CustomerView>(strQuery, new DynamicParameters());
return output.ToList(); return output.ToList();
} }
} }
public static void saveCustomer(employeeView customer) public static void SaveCustomer(EmployeeView customer)
{ {
} }