private void dequeueButton_Click(object sender, EventArgs e) { if (queueListView.Items.Count != 0) { CustomerInfo customer = new CustomerInfo(); customer = customerInfos.Dequeue(); serialNoTextBox.Text = customer.serialNo; dequeueNameTextBox.Text = customer.name; dequeueComplainTextBox.Text = customer.complain; queueListView.Items.RemoveAt(0); } else MessageBox.Show("Empty List Box"); // remove selected item. //queueListView.Items.Clear(); // clear full list view. }
private void dequeueButton_Click(object sender, EventArgs e) { if (queueListView.Items.Count != 0) { CustomerInfo customer = new CustomerInfo(); customer = customerInfos.Dequeue(); serialNoTextBox.Text = customer.serialNo; dequeueNameTextBox.Text = customer.name; dequeueComplainTextBox.Text = customer.complain; queueListView.Items.RemoveAt(0); } else { MessageBox.Show("Empty List Box"); } // remove selected item. //queueListView.Items.Clear(); // clear full list view. }
private void enqueueButton_Click(object sender, EventArgs e) { CustomerInfo customer = new CustomerInfo(); customer.serialNo = Convert.ToString(++serialNumber); customer.name = enqueueNameTextBox.Text; customer.complain = enqueueComplainTextBox.Text; customerInfos.Enqueue(customer); MessageBox.Show(customer.name +" your serial no is" +customer.serialNo); ListViewItem cuListViewItem=new ListViewItem(customer.serialNo); cuListViewItem.SubItems.Add(customer.name); cuListViewItem.SubItems.Add(customer.complain); queueListView.Items.Add(cuListViewItem); enqueueNameTextBox.Text=""; enqueueComplainTextBox.Text = ""; }