public ActionResult DeleteConfirmed(int id) { Health_Info health_Info = db.Health_Info.Find(id); db.Health_Info.Remove(health_Info); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "Id,Alchol_Consumption,Smoking,Height,Weight,Mood_Level,Date")] Health_Info health_Info) { health_Info.PId = User.Identity.GetUserId(); if (ModelState.IsValid) { db.Health_Info.Add(health_Info); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PId = new SelectList(db.Personal_Info, "Id", "Fname", health_Info.PId); return(View(health_Info)); }
// GET: Health_Info/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Health_Info health_Info = db.Health_Info.Find(id); if (health_Info == null) { return(HttpNotFound()); } return(View(health_Info)); }
// GET: Health_Info/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Health_Info health_Info = db.Health_Info.Find(id); if (health_Info == null) { return(HttpNotFound()); } ViewBag.Date = health_Info.Date.ToShortDateString(); ViewBag.PId = new SelectList(db.Personal_Info, "Id", "Fname", health_Info.PId); return(View(health_Info)); }
public void Update(Health_Info obj) { DbSet.Update(obj); }
public void Add(Health_Info obj) { DbSet.Add(obj); }