Update employee view class

update employee view query
update methods to change from employeeview to reportview
This commit is contained in:
kougyoku 2019-10-15 08:42:17 -07:00
parent 74af82d70c
commit 7116e25a81
2 changed files with 9 additions and 6 deletions

View File

@ -32,8 +32,6 @@ namespace QueueSys
{
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; }
}
@ -45,7 +43,7 @@ namespace QueueSys
//database will be closed, even in event of an application or computer crash.
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
{
string strQuery = "SELECT id,customer_name,num_bags,employee,status FROM active_customers;";
string strQuery = "SELECT id,customer_name,status_lookup.status as Status FROM active_customers INNER JOIN status_lookup on active_customers.status_id=status_lookup.status_id;";
var output = cnn.Query<EmployeeView>(strQuery, new DynamicParameters());
return output.ToList();
@ -63,7 +61,7 @@ namespace QueueSys
}
}
public void SaveCustomer(EmployeeView customer)
public void SaveCustomer(ReportView customer)
{
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
{
@ -72,7 +70,7 @@ namespace QueueSys
}
}
public void ArchiveCustomer(EmployeeView customer)
public void ArchiveCustomer(ReportView customer)
{
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
{

View File

@ -58,7 +58,7 @@ namespace QueueSys
private void btnAdd_Click(object sender, EventArgs e)
{
SqliteDataAccess sda = new SqliteDataAccess();
EmployeeView evNewCx = new EmployeeView();
ReportView evNewCx = new ReportView();
evNewCx.customer_name = tbCustomerName.Text;
evNewCx.num_bags = Int32.Parse(cbNumBags.Text);
@ -75,5 +75,10 @@ namespace QueueSys
MessageBox.Show("Customer has been added!", "Queue System", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void RefreshEmployeeView()
{
}
}
}