public ActionResult AddNewIllness(illness illness) { if (ModelState.IsValid) { _illRepo.saveIllness(illness); } return(RedirectToAction("DoctorHome")); }
public ActionResult EditIllnessInfo(int IllnessId) { illness ill = _illRepo.illnessTable.FirstOrDefault(u => u.IllnessId == IllnessId); if (ill != null) { return(View(ill)); } return(RedirectToAction("IllnessView")); }
public void DeleteIllness(int id) { illness ill = _dbContext.Illness.Find(id); if (ill != null) { _dbContext.Illness.Remove(ill); } _dbContext.SaveChanges(); }
public ActionResult ViewDetails(int IllnessId) { illness ill = _illness.illnessTable.FirstOrDefault(i => i.IllnessId == IllnessId); Session["ill"] = ill; if (ill != null) { return(View("ViewDetails")); } return(View()); }
public void SaveIllness(illness ill) { if (ill.IllnessId == 0) { _dbContext.Illness.Add(ill); } else { illness illEntity = _dbContext.Illness.Find(ill.IllnessId); illEntity.Change(ill); } _dbContext.SaveChanges(); }
public ActionResult SaveIllness(illness illness) { if (ModelState.IsValid) { if (Request.Form["_btnSubmit"] == "Save Info") { _illRepo.saveIllness(illness); } else if (Request.Form["_btnSubmit"] == "Delete Illness") { _illRepo.DeleteIllness(illness.IllnessId); } } return(RedirectToAction("IllnessView")); }
public bool Delete(illness entity) { return(_illnesDal.Delete(entity)); }
public bool Update(illness entity) { return(_illnesDal.Update(entity)); }
public bool Add(illness entity) { return(_illnesDal.Add(entity)); }
public illness Get(illness entity) { return(_illnesDal.Get(p => p.illnessid == entity.illnessid)); }