public List <dynamic> getAllCountry() { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; return(getCountryList(db.Countries.Include(pp => pp.Risk.Risk1).ToList())); }
public List <dynamic> getAllCycle() { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; return(getCycleList(db.Infection_Cycle.ToList())); }
public List <dynamic> getAllMalariaType() { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; return(getMalariaTypeList(db.Malaria_Type.ToList())); }
public List <dynamic> getAllPreventitive() { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; return(getPreventitiveList(db.Preventative_Measure.ToList())); }
public List <dynamic> getAllQuickFact() { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; return(getQuickFactList(db.Quick_Fact.ToList())); }
public List <dynamic> getAllSymptom() { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; return(getSymptomList(db.Symptoms.ToList())); }
public List <dynamic> getAllAbout() { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; return(getAboutList(db.Malarias.ToList())); }
public List <dynamic> getAllVaccination() { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; return(getVaccinationList(db.Vaccinations.ToList())); }
public List <dynamic> AddCause([FromBody] Cause causes) { if (causes != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; db.Causes.Add(causes); db.SaveChanges(); return(getAllCause()); } else { return(null); } }
public List <dynamic> AddCountry([FromBody] Country country) { if (country != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; db.Countries.Add(country); db.SaveChanges(); return(getAllCountry()); } else { return(null); } }
public List <dynamic> UpdateAbout([FromBody] Malaria malaria) { //Malaria objMal = new Malaria(); // objMal = db.Malarias.Find(malaria.Malaria_ID == 1); // if (malaria != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Malaria objMal = db.Malarias.Where(p => p.Malaria_ID == 1).FirstOrDefault(); objMal.Malaria_Background = malaria.Malaria_Background; db.SaveChanges(); } return(getAllAbout()); }
public List <dynamic> AddMalariaType([FromBody] Malaria_Type malaria_Type) { if (malaria_Type != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; db.Malaria_Type.Add(malaria_Type); db.SaveChanges(); return(getAllMalariaType()); } else { return(null); } }
public List <dynamic> AddSymptom([FromBody] Symptom symptom) { if (symptom != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; db.Symptoms.Add(symptom); db.SaveChanges(); return(getAllSymptom()); } else { return(null); } }
public List <dynamic> AddPreventitive([FromBody] Preventative_Measure preventative_Measure) { if (preventative_Measure != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; db.Preventative_Measure.Add(preventative_Measure); db.SaveChanges(); return(getAllPreventitive()); } else { return(null); } }
public List <dynamic> UpdateMalariaType([FromBody] Malaria_Type malaria_Type) { if (malaria_Type != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Malaria_Type objMal = db.Malaria_Type.Where(p => p.Malaria_Type_ID == malaria_Type.Malaria_Type_ID).FirstOrDefault(); objMal.Malaria_Type1 = malaria_Type.Malaria_Type1; db.SaveChanges(); return(getAllMalariaType()); } else { return(null); } }
public List <dynamic> UpdatePreventitive([FromBody] Preventative_Measure preventative_Measure) { if (preventative_Measure != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Preventative_Measure objPrev = db.Preventative_Measure.Where(p => p.Preventative_Measure_ID == preventative_Measure.Preventative_Measure_ID).FirstOrDefault(); objPrev.Measure_Description = preventative_Measure.Measure_Description; db.SaveChanges(); return(getAllPreventitive()); } else { return(null); } }
public List <dynamic> UpdateSymptom([FromBody] Symptom symptom) { if (symptom != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Symptom objSym = db.Symptoms.Where(p => p.Symptom_ID == symptom.Symptom_ID).FirstOrDefault(); objSym.Symptom_Name = symptom.Symptom_Name; db.SaveChanges(); return(getAllSymptom()); } else { return(null); } }
public List <dynamic> UpdateQuickFact([FromBody] Quick_Fact quick_Fact) { if (quick_Fact != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Quick_Fact objFact = db.Quick_Fact.Where(p => p.Quick_Fact_ID == quick_Fact.Quick_Fact_ID).FirstOrDefault(); objFact.Fact = quick_Fact.Fact; db.SaveChanges(); return(getAllQuickFact()); } else { return(null); } }
public List <dynamic> UpdateCountry([FromBody] Country country) { if (country != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Country objCou = db.Countries.Where(p => p.Country_ID == country.Country_ID).FirstOrDefault(); objCou.Country_Name = country.Country_Name; db.SaveChanges(); return(getAllCountry()); } else { return(null); } }
public List <dynamic> UpdateVaccination([FromBody] Vaccination vaccination) { if (vaccination != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Vaccination objVac = db.Vaccinations.Where(p => p.Vaccination_ID == vaccination.Vaccination_ID).FirstOrDefault(); objVac.Vaccination_Description = vaccination.Vaccination_Description; db.SaveChanges(); return(getAllVaccination()); } else { return(null); } }
public List <dynamic> UpdateCause([FromBody] Cause causes) { if (causes != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Cause objCau = db.Causes.Where(p => p.Cause_ID == causes.Cause_ID).FirstOrDefault(); objCau.Cause_Name = causes.Cause_Name; db.SaveChanges(); return(getAllCause()); } else { return(null); } }
public List <dynamic> UpdateCycle([FromBody] Infection_Cycle infection_Cycle) { if (infection_Cycle != null) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Infection_Cycle objCyc = db.Infection_Cycle.Where(p => p.Cycle_ID == infection_Cycle.Cycle_ID).FirstOrDefault(); objCyc.Cycle_Head = infection_Cycle.Cycle_Head; objCyc.Cycle_Description = infection_Cycle.Cycle_Description; db.SaveChanges(); return(getAllCycle()); } else { return(null); } }
public List <dynamic> DeleteVaccination(int ID) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Vaccination objVac = db.Vaccinations.Where(p => p.Vaccination_ID == ID).FirstOrDefault(); if (objVac != null) { db.Vaccinations.Remove(objVac); db.SaveChanges(); return(getAllVaccination()); } else { return(null); } }
public List <dynamic> DeleteMeasure(int ID) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Preventative_Measure objPrev = db.Preventative_Measure.Where(p => p.Preventative_Measure_ID == ID).FirstOrDefault(); if (objPrev != null) { db.Preventative_Measure.Remove(objPrev); db.SaveChanges(); return(getAllPreventitive()); } else { return(null); } }
public List <dynamic> DeleteMalariaType(int ID) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Malaria_Type objMal = db.Malaria_Type.Where(p => p.Malaria_Type_ID == ID).FirstOrDefault(); if (objMal != null) { db.Malaria_Type.Remove(objMal); db.SaveChanges(); return(getAllMalariaType()); } else { return(null); } }
public List <dynamic> DeleteQuickFact(int ID) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Quick_Fact objFact = db.Quick_Fact.Where(p => p.Quick_Fact_ID == ID).FirstOrDefault(); if (objFact != null) { db.Quick_Fact.Remove(objFact); db.SaveChanges(); return(getAllQuickFact()); } else { return(null); } }
public List <dynamic> DeleteCountry(int ID) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Country objCou = db.Countries.Where(p => p.Country_ID == ID).FirstOrDefault(); if (objCou != null) { db.Countries.Remove(objCou); db.SaveChanges(); return(getAllCountry()); } else { return(null); } }
public List <dynamic> DeleteSymptom(int ID) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Symptom objSym = db.Symptoms.Where(p => p.Symptom_ID == ID).FirstOrDefault(); if (objSym != null) { db.Symptoms.Remove(objSym); db.SaveChanges(); return(getAllSymptom()); } else { return(null); } }
public List <dynamic> DeleteCycle(int ID) { MalariaEntities1 db = new MalariaEntities1(); db.Configuration.ProxyCreationEnabled = false; Infection_Cycle objCyc = db.Infection_Cycle.Where(p => p.Cycle_ID == ID).FirstOrDefault(); if (objCyc != null) { db.Infection_Cycle.Remove(objCyc); db.SaveChanges(); return(getAllCycle()); } else { return(null); } }