We are working on a school assignment where we are supposed to do the page which must be able to show a full list of all the customers and also be able to show a list of the names of all from Jutland, a list of the names of all customers from Funen and a list of the names of all customers from Zealand.

Problem:
Instead of showing customers that are specific to one region (e.g Jutland), the system will add both the previous and the new customer (who is from a different region) into the same field, which represents the different region. Thus, the system cannot make a distinction between the individual regions of the customers.
In the screenshot above, the name Stanislav is supposed to be the only one in the ListBox. However, Sebastian, who belongs to another region, hence the other list box, is added as well. We believe it might have something to do with the foreach loop, although we are not entirely sure.
Any assistance will be greatly appreciated!
namespace _2ndHandinCsharp
{
public partial class register : System.Web.UI.Page
{
private CustomerTank thetank;
protected void Page_Load(object sender, EventArgs e)
{
if (Application["SharedCustomerTank"]== null)
{
Application["SharedCustomerTank"] = new CustomerTank();
}
thetank = (CustomerTank)Application["SharedCustomerTank"];
}
protected void ButtonUpdate_Click(object sender, EventArgs e)
{
thetank = (CustomerTank)Application["SharedCustomerTank"];
UpdateCustomerListView();
}
private void UpdateCustomerListView()
{
ListBox1.Items.Clear();
List<Customer> customerInTheTank = thetank.TheCustomers();
foreach(Customer c in customerInTheTank)
{
ListBox1.Items.Add(c.ToString());
}
}
private void UpdateCustomerListViewJutland()
{
List<Customer> customerInTheTank = thetank.TheCustomers();
for (int i = 0; i < customerInTheTank.Count; i++)
{
if (DropDownListRegion.SelectedValue == "Jutland")
{
ListBoxJutland.Items.Add(customerInTheTank[i].Name);
}
}
}
private void UpdateCustomerListViewFunen()
{
List<Customer> customerInTheTank = thetank.TheCustomers();
for (int i=0; i<customerInTheTank.Count;i++)
{
if (DropDownListRegion.SelectedValue == "Funen")
{
ListBoxFunen.Items.Add(customerInTheTank[i].Name);
}
}
}
protected void ButtonAddCustomer_Click(object sender, EventArgs e)
{
Customer c = new Customer(
TextBoxName.Text,
TextBoxPassword.Text,
int.Parse(TextBoxAge.Text),
TextBoxZip.Text,
DropDownListRegion.Text);
Application.Lock();
thetank = (CustomerTank)Application["SharedCustomerTank"];
thetank.AddCustomer(c);
Application["SharedCustomerTank"] = thetank;
Application.UnLock();
UpdateCustomerListView();
UpdateCustomerListViewJutland();
UpdateCustomerListViewFunen();
}
}
}`