public void GetVoter() { Voter aVoter = new Voter(); VoterId = patientVoterIdTextBox.Text; aVoter.id = VoterId; aVoter = centerManager.GetVoterInformation(aVoter.id); patientNameTextBox.Text = aVoter.name; patientAddressTextBox.Text = aVoter.address; }
protected void showDetailsButton_Click1(object sender, EventArgs e) { Voter aVoter = new Voter(); string voterId = patientVoterIdTextBox.Text; aVoter.id = voterId; aVoter = centerManager.GetVoterInformation(aVoter.id); patientNameTextBox.Text = aVoter.name; patientAddressTextBox.Text = aVoter.address; patientAgeTextBox.Text = centerManager.CalculateAge(aVoter.date_of_birth).ToString(); List<Treatment> treatMent = centerManager.GetNumberofServiceTaken(voterId); int serviceGiven = 0; foreach (var count in treatMent) { if (count != null) { serviceGiven++; } } serviceTimeTextBox.Text = serviceGiven.ToString(); }
public Voter GetVoterInformation(string givenId) { List<Voter> voterList = centerGateway.GetVoterInformation(); Voter aVoter = new Voter(); foreach (var voter in voterList) { if (voter.id == givenId) { aVoter.name = voter.name; aVoter.address = voter.address; aVoter.date_of_birth = voter.date_of_birth; } } return aVoter; }