public void AddCustomerToQueue(QueueInstruction instruction) { var queueInstruction = new Database.QueueTransaction() { BusinessId = 1, QueueJoinDateTime = instruction.QueueJoinTime, ExpectedEntryDateTime = instruction.ExpectedEntryTime, ActualEntryDateTime = instruction.ActualEntryTime, ExitTime = instruction.ExitTime, PatronId = instruction.PatronId, UserLedgerId = instruction.UserLedgerId }; dbContext.QueueTransactions.Add(queueInstruction); dbContext.SaveChanges(); }
public bool LeaveQueue(QueueInstruction leaveInstruction) { if (leaveInstruction.SessionId != null) { // Get Customer Queue var userQueue = dbContext.spGetUserQueue(leaveInstruction.SessionId, leaveInstruction.BusinessId); int queueId = 0; foreach (var item in userQueue) { queueId = item.Id; } if (queueId != 0) { SaveCustomerQueueExit(queueId); } return(true); } return(false); }