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();
        }
示例#4
0
        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"));
 }
示例#7
0
 public bool Delete(illness entity)
 {
     return(_illnesDal.Delete(entity));
 }
示例#8
0
 public bool Update(illness entity)
 {
     return(_illnesDal.Update(entity));
 }
示例#9
0
 public bool Add(illness entity)
 {
     return(_illnesDal.Add(entity));
 }
示例#10
0
 public illness Get(illness entity)
 {
     return(_illnesDal.Get(p => p.illnessid == entity.illnessid));
 }