public List <DiseaseWithSymptom> diagnoses(string patientName, int id1) { SqlConnection con = new SqlConnection(@"Data Source=.;Database=Medical_Research; integrated security= SSPI"); //con.Open(); List <DiseaseWithSymptom> diseaseWithSymptoms = new List <DiseaseWithSymptom>(); SqlCommand sc = new SqlCommand("Diagnose2", con); sc.CommandType = CommandType.StoredProcedure; sc.Parameters.AddWithValue("@ID1", id1); con.Open(); SqlDataReader sdr = sc.ExecuteReader(); while (sdr.Read()) { DiseaseWithSymptom diseaseWithSymptom = new DiseaseWithSymptom(); diseaseWithSymptom.DsDisease = new Disease(); diseaseWithSymptom.DsDisease.DiseaseName = (string)sdr["DiseaseName"]; diseaseWithSymptom.DsDisease.DiseaseSeverity.SeverityName = (string)sdr["Severity"]; diseaseWithSymptom.DsSymptom = new Symptom(); diseaseWithSymptom.DsSymptom.SymptomName = (string)sdr["Symptom"]; diseaseWithSymptoms.Add(diseaseWithSymptom); } con.Close(); return(diseaseWithSymptoms); }
public void addSymptomsDisease(DiseaseWithSymptom diseaseWithSymptom) { SqlConnection con = new SqlConnection(@"Data Source=.;Database=Medical_Research; integrated security= SSPI"); con.Open(); SqlCommand sc = new SqlCommand($"insert into DiseasewithSymptom values('{diseaseWithSymptom.DsDisease.DiseaseId}','{diseaseWithSymptom.DsSymptom.SymptomId}','{diseaseWithSymptom.SymptomDescription}')", con); sc.ExecuteNonQuery(); con.Close(); }
public void addSymptomsDisease(DiseaseWithSymptomModel diseaseWithSymptomModel) { DiseaseWithSymptom diseaseWithSymptom = new DiseaseWithSymptom(); diseaseWithSymptom.DsDisease = new Disease(); diseaseWithSymptom.DsDisease.DiseaseId = diseaseWithSymptomModel.DsDisease.DiseaseId; diseaseWithSymptom.DsSymptom = new Symptom(); diseaseWithSymptom.DsSymptom.SymptomId = diseaseWithSymptomModel.DsSymptom.SymptomId; diseaseWithSymptom.SymptomDescription = diseaseWithSymptomModel.SymptomDescription; Business business = new Business(); business.addSymptomsDisease(diseaseWithSymptom); }
public void addSymptomsDisease(DiseaseWithSymptom diseaseWithSymptom) { Data data = new Data(); data.addSymptomsDisease(diseaseWithSymptom); }