public void GetQueues() { try { var pageNumber = 1; var pageCount = 1; queueList = new List <QueueInfo>(); AddLog($"Getting Queues"); do { var queueEntityListing = routingApi.GetRoutingQueues(100, pageNumber++, null, null, null); pageCount = queueEntityListing.PageCount.Value; foreach (var queue in queueEntityListing.Entities) { //queueList.Add(new QueueInfo(queue.Id, queue.Name, queue.MemberCount)); queueList.Add(new QueueInfo(queue.Id, queue.Name, queue.MemberCount, queue.AcwSettings.TimeoutMs, queue.AcwSettings.WrapupPrompt)); AddLog("Get " + queue.Name + " - " + queue.AcwSettings.WrapupPrompt + " - " + queue.AcwSettings.TimeoutMs); } } while (pageNumber <= pageCount); } catch (Exception ex) { AddLog($"Error in GetQueues: {ex.Message}"); MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void GetQueues() { try { AddLog("Clearing current queues...", true); cmbQueues.Items.Clear(); var pageNumber = 1; var pageCount = 1; do { var queueEntityListing = routingApi.GetRoutingQueues(100, pageNumber++, null, null, true); foreach (var queue in queueEntityListing.Entities) { cmbQueues.Items.Add(new QueueInfo(queue.Id, queue.Name)); } } while (pageNumber <= pageCount && loggedIn); cmbQueues.SelectedIndex = 0; } catch (Exception ex) { AddLog($"Error in GetQueues: {ex.Message}"); AddLog($"Detailled error: {ex}", true); MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }