Update RefreshEmployeeView, there is a better way to clear the columns.

Add: Update end_time attribute in sqlite db when customer is marked 'ready'
This commit is contained in:
kougyoku 2019-11-07 09:48:07 -08:00
parent 63e8550fb0
commit c603d8fed6
1 changed files with 17 additions and 7 deletions

View File

@ -121,13 +121,14 @@ namespace QueueSys
private void RefreshEmployeeView()
{
dgvEmployeeView.Rows.Clear();
dgvEmployeeView.Columns.Clear();
dgvEmployeeView.Columns.Add("CustomerID", "CustomerID");
dgvEmployeeView.Columns.Add("CustomerName", "CustomerName");
dgvEmployeeView.Columns[0].Width = 150;
dgvEmployeeView.Columns[0].ReadOnly = true;
dgvEmployeeView.Columns[1].Width = 150;
dgvEmployeeView.Columns[1].ReadOnly = true;
//Clear the status and delete columns
//as it fixes a bug duplicating these columns.
if (dgvEmployeeView.Columns.Count == 4)
{
dgvEmployeeView.Columns.Remove(dgvEmployeeView.Columns[3]);
dgvEmployeeView.Columns.Remove(dgvEmployeeView.Columns[2]);
}
dgvEmployeeView.Refresh();
// Build the row.
@ -253,6 +254,15 @@ namespace QueueSys
*/
sdaEvView.UpdateCustomerStatus(CustomerId, new_status);
if(new_status == "Ready")
{
sdaEvView.UpdateEndTime(CustomerId, "add");
}
else
{
sdaEvView.UpdateEndTime(CustomerId, "remove");
}
//Invoke the delegate to update customer view with updated data.
OnSendMessage?.Invoke(this, e);
}