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:
parent
63e8550fb0
commit
c603d8fed6
|
@ -121,13 +121,14 @@ namespace QueueSys
|
||||||
private void RefreshEmployeeView()
|
private void RefreshEmployeeView()
|
||||||
{
|
{
|
||||||
dgvEmployeeView.Rows.Clear();
|
dgvEmployeeView.Rows.Clear();
|
||||||
dgvEmployeeView.Columns.Clear();
|
|
||||||
dgvEmployeeView.Columns.Add("CustomerID", "CustomerID");
|
//Clear the status and delete columns
|
||||||
dgvEmployeeView.Columns.Add("CustomerName", "CustomerName");
|
//as it fixes a bug duplicating these columns.
|
||||||
dgvEmployeeView.Columns[0].Width = 150;
|
if (dgvEmployeeView.Columns.Count == 4)
|
||||||
dgvEmployeeView.Columns[0].ReadOnly = true;
|
{
|
||||||
dgvEmployeeView.Columns[1].Width = 150;
|
dgvEmployeeView.Columns.Remove(dgvEmployeeView.Columns[3]);
|
||||||
dgvEmployeeView.Columns[1].ReadOnly = true;
|
dgvEmployeeView.Columns.Remove(dgvEmployeeView.Columns[2]);
|
||||||
|
}
|
||||||
dgvEmployeeView.Refresh();
|
dgvEmployeeView.Refresh();
|
||||||
|
|
||||||
// Build the row.
|
// Build the row.
|
||||||
|
@ -253,6 +254,15 @@ namespace QueueSys
|
||||||
*/
|
*/
|
||||||
sdaEvView.UpdateCustomerStatus(CustomerId, new_status);
|
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.
|
//Invoke the delegate to update customer view with updated data.
|
||||||
OnSendMessage?.Invoke(this, e);
|
OnSendMessage?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue