public void CreateTreatmentHistoryControls() { string voterid = nationalIdTextBox.Text; int treatment = 1; histories = centerManager.GetHistory(voterid); string centername = ""; string date = ""; string doctorname = ""; string observation = ""; foreach (PartialTreatmentHistory treatments in histories) { centername = treatments.CenterName; date = treatments.Date; doctorname = treatments.DoctorName; observation = treatments.Observation; } Label treatmentlabel = new Label(); treatmentlabel.ID = "treatmentid"; treatmentlabel.Text = "Treatment :" + treatment; Label centerNameLabel = new Label(); centerNameLabel.ID = "centerNameLabel"; centerNameLabel.Text += "Center Name: "; Label showcenterName = new Label(); showcenterName.ID = "showcenterName"; showcenterName.Text += centername; Label dateLabel = new Label(); dateLabel.ID = "dateLabel"; dateLabel.Text += "Date : "; Label showdate = new Label(); showdate.ID = "showdate"; showdate.Text += date; Label doctorLabel = new Label(); doctorLabel.ID = "doctorLabel"; doctorLabel.Text += "Doctor : "; Label showdoctor = new Label(); showdoctor.ID = "showdate"; showdoctor.Text += doctorname; Label observationLabel = new Label(); observationLabel.ID = "doctorLabel"; observationLabel.Text += "Doctor : "; Label showobservation = new Label(); showobservation.ID = "showdate"; showobservation.Text += doctorname; centerInfo.Controls.Add(new LiteralControl("<br/>")); centerInfo.Controls.Add(treatmentlabel); centerInfo.Controls.Add(new LiteralControl("<br/>")); centerInfo.Controls.Add(centerNameLabel); centerInfo.Controls.Add(showcenterName); centerInfo.Controls.Add(new LiteralControl("<br/>")); centerInfo.Controls.Add(dateLabel); centerInfo.Controls.Add(showdate); centerInfo.Controls.Add(new LiteralControl("<br/>")); centerInfo.Controls.Add(doctorLabel); centerInfo.Controls.Add(showdoctor); centerInfo.Controls.Add(new LiteralControl("<br/>")); centerInfo.Controls.Add(observationLabel); centerInfo.Controls.Add(showobservation); centerInfo.Controls.Add(new LiteralControl("<br/>")); }