public void GetPatientInformation(string voterId)
        {
            List<Voter> voterList = new List<Voter>();
            using (var client = new WebClient())
            {
                var url = "http://nerdcastlebd.com/web_service/voterdb/index.php/voters/all/format/json";
                var jsonString = client.DownloadString(url);
                var json = new JavaScriptSerializer().Deserialize<dynamic>(jsonString);
                foreach (Dictionary<string, object> voter in json["voters"])
                {
                    Voter aVoter = new Voter();
                    aVoter.Id = voter["id"].ToString();
                    aVoter.Name = voter["name"].ToString();
                    aVoter.Address = voter["address"].ToString();
                    voterList.Add(aVoter);
                }
            }

            //string jsonStringCollection = "[{\"id\":\"5644309456813\",\"name\":\"Rimi Khanom\",\"address\":\"House no: 12. Road no: 14. Dhanmondi, Dhaka\",\"date_of_birth\":\"1979-01-15\"},{\"id\":\"9509623450915\",\"name\":\"Asif Latif\",\"address\":\"House no: 98. Road no: 14. Katalgonj, Chittagong\",\"date_of_birth\":\"1988-07-11\"},{\"id\":\"1098789543218\",\"name\":\"Rakib Hasan\",\"address\":\"Vill. Shantinagar. Thana: Katalgonj, Faridpur\",\"date_of_birth\":\"1982-04-12\"},{\"id\":\"7865409458659\",\"name\":\"Rumon Sarker\",\"address\":\"Kishorginj\",\"date_of_birth\":\"1970-12-02\"},{\"id\":\"8909854343334\",\"name\":\"Gaji Salah Uddin\",\"address\":\"Chittagong\",\"date_of_birth\":\"1965-06-16\"}]";
            //List<Voter> voterList = new JavaScriptSerializer().Deserialize<List<Voter>>(jsonStringCollection);
            foreach (var voter in voterList)
            {

                if (voter.Id.Equals(voterId))
                {
                    nameTextBox.Text = voter.Name;
                    addressTextBox.Text = voter.Address;

                }
            }
        }
        protected void pdfButton_Click(object sender, EventArgs e)
        {
            Document doc = new Document(PageSize.A4, 36, 72, 108, 180);
            string path = @"D:\";
            PdfWriter.GetInstance(doc, new FileStream(path + "/Treatment.pdf", FileMode.Create));
            doc.Open();
            Voter aVoter = new Voter();
            aVoter.Id=nationalIdTextBox.Text;
            aVoter.Name = nameTextBox.Text;
            aVoter.Address = addressTextBox.Text;
                Paragraph paragraph = new Paragraph();
                paragraph.Add("National Id : " + aVoter.Id);
                paragraph.Add(Environment.NewLine);
                paragraph.Add("Name : " + aVoter.Name);
                paragraph.Add(Environment.NewLine);
                paragraph.Add("Address :" + aVoter.Address);
                paragraph.Add(Environment.NewLine);
                paragraph.Add(Environment.NewLine);
                doc.Add(paragraph);

                Patient aPatient = new Patient();
                aPatient.VoterId = nationalIdTextBox.Text;
                GetPatientInformation(aPatient.VoterId);
                aPatient.Id = patientManager.GetPatientId(aPatient);

             int count = 0;
                List<Treatment> ObservationList = treatmentManager.GetObservationList(aPatient);
                foreach (var observation in ObservationList)
                {
                    count++;
                    PdfPTable table = new PdfPTable(1);
                    Paragraph aParagraph = new Paragraph();
                    Chunk chunk = new Chunk("Treatment-" + count, FontFactory.GetFont("dax-black"));
                    chunk.SetUnderline(0.5f, -1.5f);
                    doc.Add(chunk);

                    string centerName = centerManager.GetCenterName(observation.CenterId);
                    aParagraph.Add("Center Name : " + centerName);
                    aParagraph.Add(Environment.NewLine);
                    string Date = observation.Date;
                    aParagraph.Add("Date : " + Date);
                    aParagraph.Add(Environment.NewLine);
                    string DoctorName = doctorManager.GetDoctorName(observation.DoctorId);
                    aParagraph.Add("Doctor Name : " + DoctorName);
                    aParagraph.Add(Environment.NewLine);
                    string Observation = observation.Observation;
                    aParagraph.Add("Observation : " + Observation);
                    aParagraph.Add(Environment.NewLine);
                    table.AddCell(aParagraph);
                    doc.Add(table);
                    List<Treatment> treatmentList = treatmentManager.GetTreatmentList(observation.ObservationId);
                    List<Treatment> aTreatmentList = new List<Treatment>();
                    foreach (var treatment in treatmentList)
                    {
                        string diseaseName = diseaseManager.GetDiseaseName(treatment.DiseaseId);
                        string medicineName = medicineManager.GetMedicineName(treatment.MedicineId);
                        Treatment aTreatment = new Treatment();
                        aTreatment.NameOfDisease = diseaseName;
                        aTreatment.NameOfMedicine = medicineName;
                        aTreatment.Dose = treatment.Dose;
                        aTreatment.TakenTime = treatment.TakenTime;
                        aTreatment.Quantity = treatment.Quantity;
                        aTreatment.Note = treatment.Note;

                        aTreatmentList.Add(aTreatment);
                    }
                    ShowAllTreatment(centerName, Date, DoctorName, Observation, count, aTreatmentList);
                    PdfPTable aTable = new PdfPTable(6);
                    aTable.AddCell("Disease");
                    aTable.AddCell("Medicine");
                    aTable.AddCell("Dose");
                    aTable.AddCell("Before/After meal");
                    aTable.AddCell("Quantity");
                    aTable.AddCell("Note");
                    foreach (var eachTreatment in aTreatmentList) {
                        aTable.AddCell(eachTreatment.NameOfDisease);
                        aTable.AddCell(eachTreatment.NameOfMedicine);
                        aTable.AddCell(eachTreatment.Dose);
                        aTable.AddCell(eachTreatment.TakenTime);
                        aTable.AddCell(eachTreatment.Quantity.ToString());
                        aTable.AddCell(eachTreatment.Note);
                    }
                    doc.Add(aTable);
                }
            doc.Close();
            Response.Redirect("OpenPdfUI.aspx");
            megLabel.Text = "PDF Creation Successful!";
        }