Hello Gurus,
Normally, when we conduct community elections, one of two rules usually applies.
1, Every one from various communities are allowed to participate in the election.
2, Only certain groups of communities are allowed to participate in the election.
I usually handle these restrictions with the following code:
With the example above, if a voter does not come from East Community, that voter is not allowed to vote and a message displaying that voters community saying the voter is allowed to vote since his/her community does not match community listed above.
This time, the requirement is different. We have two elections, one election going in East Community only and another going on for ALL communities.
The rule this time is that if you are from East Community, you can participate in both East Community election as well as the general election involving all communities.
However, if you are not from East Community, you can participate in general election but NOT in the East Community election.
Any ideas how to modify above code to satisfy this rule?
Thanks in advance
Normally, when we conduct community elections, one of two rules usually applies.
1, Every one from various communities are allowed to participate in the election.
2, Only certain groups of communities are allowed to participate in the election.
I usually handle these restrictions with the following code:
Dim CommunitiesAllowed = New List(Of String)(
{ _
"East Community" _
})
If Not CommunitiesAllowed .Contains(txtComm.Text) Then
lblNA.Text = "Voters in community"& txtComm.Text & " are not eligible to vote in this election."
End If
With the example above, if a voter does not come from East Community, that voter is not allowed to vote and a message displaying that voters community saying the voter is allowed to vote since his/her community does not match community listed above.
This time, the requirement is different. We have two elections, one election going in East Community only and another going on for ALL communities.
The rule this time is that if you are from East Community, you can participate in both East Community election as well as the general election involving all communities.
However, if you are not from East Community, you can participate in general election but NOT in the East Community election.
Any ideas how to modify above code to satisfy this rule?
Thanks in advance