protected void addButton_Click(object sender, EventArgs e) { Treatment aTreatment = new Treatment(); aTreatment.DiseaseId = aDiseaseManager.GetDiseaseId(diseaseDropDownList.Text); aTreatment.PatientId = voterIdTextBox.Text; aTreatment.MedicineId = aMedicineManager.GetMedicineIdByName(medicineDropDownList.Text); aTreatment.Dose = doseDropDownList.Text; if (RadioButton1.Checked == true) { aTreatment.BeforeAfter = "Before Meal"; } else { aTreatment.BeforeAfter = "After Meal"; } aTreatment.MedicineQty = Convert.ToInt32(quantityTextBox.Text); aTreatment.Note = noteTextBox.Text; aTreatment.Date = dateTextBox.Text; aTreatment.Count = Convert.ToInt32(serviceNumberTextBox.Text) + 1; aTreatment.CenterId = Convert.ToInt32(Session["center_id"].ToString()); // if (aCenterMedicineRelationManager.GetMedicineQty(Convert.ToInt32(Session["center_id"].ToString()), aTreatment.MedicineId) < Convert.ToInt32(quantityTextBox.Text)) { Label16.Text = "Out Of stock "; } else { AddTreatementInQueue(aTreatment); AddTreatmentInViewState(aTreatment); } }
protected void selectButton_Click(object sender, EventArgs e) { List <string> disList = aDistrictThanaManager.GetDistrictList(); DataTable dt = new DataTable(); dt.Columns.Add("District Name"); dt.Columns.Add("Total Patient"); dt.Columns.Add("% On Population"); for (int j = 1; j < disList.Count; j++) { string s = disList[j]; int districtId = aDistrictThanaManager.GetDistrictId(s); List <int> thanalList = aDistrictThanaManager.GetThanaIDList(districtId); List <int> centerList = new List <int>(); foreach (int i in thanalList) { List <int> aList = aCenterManager.GetCenterListByThanaID(i); foreach (int i1 in aList) { centerList.Add(i1); } } int total = 0; int diseaseId = aDiseaseManager.GetDiseaseId(selectDropDownList.Text); foreach (int i in centerList) { total += aTreatementManager.GetTotalByCenterDisease(i, diseaseId, startTextBox.Text, endTextBox.Text); } int totalpopulation = aDistrictThanaManager.GetPopulation(districtId); double per = ((double)total / totalpopulation) * 100; dt.Rows.Add(s, total, per); } diseaseGridView.DataSource = dt; diseaseGridView.DataBind(); }