protected void ButtonPatientHistorySubmit_Click(object sender, EventArgs e) { int id = (int)Session["id"]; bool isExist = true; /*string fname = this.TextboxPatientHistoryFirstname.Text; * string lname = this.TextboxPatientHistoryLastname.Text; * string mobile = this.TextboxPatientHistoryMobile.Text; * string gender = this.RadioButtonListPatientHistoryGender.Text; * string birthday = this.TextboxPatientHistoryBirthday.Text; * float height = float.Parse(this.TextboxPatientHistoryHeight.Text); * float weight = float.Parse(this.TextboxPatientHistoryWeight.Text); * * WebApplication1.scripts.personalData data = new scripts.personalData(); * WebApplication1.scripts.personalDataDAO dataDao = new scripts.personalDataDAO(); * * if (dataDao.getDataByID(id).getId() == 0) isExist = false; * * data.setId(id); * data.setFname(fname); * data.setLname(lname); * data.setMobile(mobile); * data.setGender(gender); * data.setBirthday(birthday); * data.setHeight(height); * data.setWeight(weight); * * * if (isExist) * { * dataDao.updateData(data); * } * else * { * dataDao.insertData(data); * } * */ isExist = true; bool[] diseases = new bool[11]; int index = 0; foreach (ListItem i in CheckBoxListDisease.Items) { if (i.Selected == true) { diseases[index] = true; } else { diseases[index] = false; } index++; } /////////////////////////////peace WebApplication1.scripts.otherDiseaseDao otherDisDao = new scripts.otherDiseaseDao(); foreach (ListItem i in BulletedListDisease.Items) { WebApplication1.scripts.otherDisease otherDis = new scripts.otherDisease(); otherDisease = i.Text; otherDis.setDisease(otherDisease); otherDis.setId(id); otherDisDao.insertDisease(otherDis); } WebApplication1.scripts.otherDrugDao otherDrDao = new scripts.otherDrugDao(); foreach (ListItem i in BulletedListDrug.Items) { WebApplication1.scripts.otherDrugs otherDrugg = new scripts.otherDrugs(); drug = i.Text; otherDrugg.setDrug(drug); otherDrugg.setId(id); otherDrDao.insertDrug(otherDrugg); } WebApplication1.scripts.otherSurgeryDao otherSurgeryDa = new scripts.otherSurgeryDao(); foreach (ListItem i in BulletedListSurgery.Items) { WebApplication1.scripts.otherSurgery otherSurg = new scripts.otherSurgery(); surgery = i.Text; otherSurg.setSurgery(drug); otherSurg.setId(id); otherSurgeryDa.insertSurgery(otherSurg); } }