Ejemplo n.º 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;
            }
        }
Ejemplo n.º 2
0
        protected void loginButton_Click(object sender, EventArgs e)
        {
            string centerCode = centerCodeTextBox.Text;
            string password   = passwordTextBox.Text;
            string enPassword = EncryptSHA512Managed(password);

            if (centerManager.IsCenterCodeAndPasswordExists(centerCode, enPassword))
            {
                Session["CenterId"] = centerManager.GetCenterId();
                int centerId = centerManager.GetCenterId();
                Session["CenterName"] = centerManager.GetCenterName(centerId);
                int thanaId = centerManager.GetThanaId(centerId);
                Session["DistrictId"] = centerManager.GetDistrictId(thanaId);
                Response.Redirect("HomeCenter.aspx");
            }
            else
            {
                megLabel.Text = "Wrong centercode and password!";
            }
        }