Пример #1
0
        protected void showButton_Click(object sender, EventArgs e)
        {
            Patient aPatient = new Patient();

            aPatient.VoterId = nationalIdTextBox.Text;
            GetPatientInformation(aPatient.VoterId);
            aPatient.Id           = patientManager.GetPatientId(aPatient);
            aPatient.ServiceTimes = patientManager.GetServiceTimes(aPatient);
            if (aPatient.ServiceTimes < 1)
            {
                megLabel.Text     = "Didn't take any treatment!";
                pdfButton.Visible = false;
            }
            else
            {
                int count = 0;
                List <Treatment> ObservationList = treatmentManager.GetObservationList(aPatient);
                foreach (var observation in ObservationList)
                {
                    count++;
                    string           centerName     = centerManager.GetCenterName(observation.CenterId);
                    string           Date           = observation.Date;
                    string           DoctorName     = doctorManager.GetDoctorName(observation.DoctorId);
                    string           Observation    = observation.Observation;
                    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);
                }
                pdfButton.Visible = true;
            }
        }