Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["user"] != "center")
            //{
            //    Response.Redirect("../index.aspx");
            //}
            //else
            //{
            int centerId = 3;

            //int centerId = Convert.ToInt32(Session["CenterId"]);
            centerLabel.Text = aCenterManager.FindById(centerId).Name;
            if (!IsPostBack)
            {
                medicineDropDownList.DataSource = aMedicineManager.GetSelectedMedicines(centerId);
                medicineDropDownList.DataBind();

                doctorDropDownList.DataSource     = aDoctorManager.GetSelectedDoctors(centerId);
                doctorDropDownList.DataTextField  = "Name";
                doctorDropDownList.DataValueField = "Id";
                doctorDropDownList.DataBind();

                diseaseDropDownList.DataSource    = aDiseaseManager.GetAllDiseases();
                diseaseDropDownList.DataTextField = "Name";
                diseaseDropDownList.DataBind();
            }
            //}
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     diseaseDropDownList.DataSource     = aDiseaseManager.GetAllDiseases();
     diseaseDropDownList.DataTextField  = "Name";
     diseaseDropDownList.DataValueField = "Id";
     diseaseDropDownList.DataBind();
 }
        protected void saveButton_Click(object sender, EventArgs e)
        {
            Disease aDisease = new Disease();

            aDisease.NameOfDisease      = nameDiseaseEntryTextBox.Text;
            aDisease.Description        = descriptionDiseaseEntryTextBox.Text;
            aDisease.TreatmentProcedure = treatmentProcedureDiseaseEntryTextBox.Text;
            msgLabel.Text = diseaseManager.SaveDisease(aDisease);
            diseaseEntryGridView.DataSource = diseaseManager.GetAllDiseases();
            diseaseEntryGridView.DataBind();
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int centerId = int.Parse(Session["CenterId"].ToString());

            if (!IsPostBack)
            {
                diseaseDropDownList.DataSource     = diseaseManager.GetAllDiseases();
                diseaseDropDownList.DataTextField  = "NameOfDisease";
                diseaseDropDownList.DataValueField = "Id";
                diseaseDropDownList.DataBind();


                medicineDropDownList.DataSource     = centerMedicineRelationManager.GetCenterAllMedicineList(centerId);
                medicineDropDownList.DataTextField  = "NameOfMedicine";
                medicineDropDownList.DataValueField = "Id";
                medicineDropDownList.DataBind();

                doctorDropDownList.DataSource     = doctorManager.GetAllDoctors(centerId);
                doctorDropDownList.DataTextField  = "DoctorName";
                doctorDropDownList.DataValueField = "Id";
                doctorDropDownList.DataBind();
            }
        }
Пример #5
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            Disease aDisease = new Disease();

            aDisease.NameOfDisease      = nameDiseaseEntryTextBox.Text;
            aDisease.Description        = descriptionDiseaseEntryTextBox.Text;
            aDisease.TreatmentProcedure = treatmentProcedureDiseaseEntryTextBox.Text;
            if (diseaseManager.IsDiseaseExists(aDisease))
            {
                megLabel.Text      = "";
                errorMegLabel.Text = "This disease already exists!";
            }
            else
            {
                errorMegLabel.Text                         = "";
                megLabel.Text                              = diseaseManager.SaveDisease(aDisease);
                nameDiseaseEntryTextBox.Text               = "";
                descriptionDiseaseEntryTextBox.Text        = "";
                treatmentProcedureDiseaseEntryTextBox.Text = "";
                diseaseEntryGridView.DataSource            = diseaseManager.GetAllDiseases();
                diseaseEntryGridView.DataBind();
            }
        }
Пример #6
0
        protected void showReportButton_Click(object sender, EventArgs e)
        {
            string dateFrom = Request.Form["dateFrom"];
            string dateTo   = Request.Form["dateTo"];

            int yearFrom  = int.Parse(dateFrom.Substring(0, 4));
            int monthFrom = int.Parse(dateFrom.Substring(5, 2));
            int dayFrom   = int.Parse(dateFrom.Substring(8, 2));


            int monthTo = int.Parse(dateTo.Substring(5, 2));
            int dayTo   = int.Parse(dateTo.Substring(8, 2));
            int yearTo  = int.Parse(dateTo.Substring(0, 4));

            List <int> patientIdList = new List <int>();

            if (yearTo < yearFrom)
            {
                megLabel.Text = "Incorrect date formet!";
            }
            else if (yearFrom == yearTo && monthTo < monthFrom)
            {
                megLabel.Text = "Incorrect date formet!";
            }
            else if (yearFrom == yearTo && monthTo == monthFrom && dayTo < dayFrom)
            {
                megLabel.Text = "Incorrect date formet!";
            }
            else
            {
                megLabel.Text = "";
                for (int i = dayFrom; ; i++)
                {
                    if (yearTo == yearFrom && monthTo == monthFrom && i == dayTo)
                    {
                        string date2    = yearFrom + "-" + monthFrom + "-" + i;
                        int    patient2 = treatmentManager.GetPatientId(date2);
                        patientIdList.Add(patient2);
                        break;
                    }
                    string date    = yearFrom + "-" + monthFrom + "-" + i;
                    int    patient = treatmentManager.GetPatientId(date);
                    patientIdList.Add(patient);
                    if (i == 31 && monthFrom != 12)
                    {
                        monthFrom++;
                        i = 0;
                    }
                    else if (monthFrom == 12 && dayFrom == 31)
                    {
                        yearFrom++;
                        monthFrom = 1;
                        i         = 0;
                    }
                }
            }
            List <int> districtWasePatientIdList = new List <int>();
            int        districtId = int.Parse(districtDropDownList.SelectedValue);

            foreach (int id in patientIdList)
            {
                int patientIdDistrictWase = patientManager.GetDistictWaisePatientId(id, districtId);
                districtWasePatientIdList.Add(patientIdDistrictWase);
            }
            List <int> observationIdList = new List <int>();

            foreach (int id in districtWasePatientIdList)
            {
                int observationId = treatmentManager.GetObservationId(id);
                observationIdList.Add(observationId);
            }
            List <Disease> diseaseNameList    = new List <Disease>();
            List <Disease> allDiseaseNameList = diseaseManager.GetAllDiseases();

            foreach (int id in observationIdList)
            {
                List <int> diseaseIdList = treatmentManager.GetDiseaseId(id);
                foreach (int disId in diseaseIdList)
                {
                    Disease aDisease = new Disease();
                    aDisease.NameOfDisease = diseaseManager.GetDiseaseName(disId);
                    diseaseNameList.Add(aDisease);
                }
            }
            Series series = Chart1.Series["Series1"];

            foreach (var diseaseName in allDiseaseNameList)
            {
                int count = 0;
                foreach (var nameOfDisease in diseaseNameList)
                {
                    if (diseaseName.NameOfDisease.Equals(nameOfDisease.NameOfDisease))
                    {
                        count++;
                    }
                }
                series.Points.AddXY(diseaseName.NameOfDisease, count);
            }
        }