public async Task <ActionResult> DeleteConfirmed(int id) { CommitteeModel_CommitteeAreaOfHealthModel committeemodel_committeeareaofhealthmodel = await db.CommitteeModel_CommitteeAreaOfHealth.FindAsync(id); db.CommitteeModel_CommitteeAreaOfHealth.Remove(committeemodel_committeeareaofhealthmodel); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "CommitteeModel_CommitteeAreaOfHealthModelID,CommitteeModelID,CommitteeAreaOfHealthModelID")] CommitteeModel_CommitteeAreaOfHealthModel committeemodel_committeeareaofhealthmodel) { if (ModelState.IsValid) { db.Entry(committeemodel_committeeareaofhealthmodel).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.CommitteeAreaOfHealthModelID = new SelectList(db.CommitteeAreaOfHealth, "CommitteeAreaOfHealthModelID", "AreaOfHealthName", committeemodel_committeeareaofhealthmodel.CommitteeAreaOfHealthModelID); ViewBag.CommitteeModelID = new SelectList(db.Committees, "CommitteeModelID", "CommitteeName", committeemodel_committeeareaofhealthmodel.CommitteeModelID); return(View(committeemodel_committeeareaofhealthmodel)); }
public async Task <ActionResult> AddCommitteeToArea([Bind(Include = "CommitteeModel_CommitteeAreaOfHealthModelID,CommitteeModelID,CommitteeAreaOfHealthModelID")] CommitteeModel_CommitteeAreaOfHealthModel committeemodel_committeeareaofhealthmodel) { if (ModelState.IsValid) { db.CommitteeModel_CommitteeAreaOfHealth.Add(committeemodel_committeeareaofhealthmodel); await db.SaveChangesAsync(); return(RedirectToAction("Details/" + committeemodel_committeeareaofhealthmodel.CommitteeModelID, "CommitteeModel")); } ViewBag.CommitteeAreaOfHealthModelID = new SelectList(db.CommitteeAreaOfHealth, "CommitteeAreaOfHealthModelID", "AreaOfHealthName", committeemodel_committeeareaofhealthmodel.CommitteeAreaOfHealthModelID); ViewBag.CommitteeModelID = committeemodel_committeeareaofhealthmodel.CommitteeModelID; return(View(committeemodel_committeeareaofhealthmodel)); }
// GET: /CommitteeModel_CommitteeAreaOfHealthModel/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CommitteeModel_CommitteeAreaOfHealthModel committeemodel_committeeareaofhealthmodel = await db.CommitteeModel_CommitteeAreaOfHealth.FindAsync(id); if (committeemodel_committeeareaofhealthmodel == null) { return(HttpNotFound()); } return(View(committeemodel_committeeareaofhealthmodel)); }
// GET: /CommitteeModel_CommitteeAreaOfHealthModel/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CommitteeModel_CommitteeAreaOfHealthModel committeemodel_committeeareaofhealthmodel = await db.CommitteeModel_CommitteeAreaOfHealth.FindAsync(id); if (committeemodel_committeeareaofhealthmodel == null) { return(HttpNotFound()); } ViewBag.CommitteeAreaOfHealthModelID = new SelectList(db.CommitteeAreaOfHealth, "CommitteeAreaOfHealthModelID", "AreaOfHealthName", committeemodel_committeeareaofhealthmodel.CommitteeAreaOfHealthModelID); ViewBag.CommitteeModelID = new SelectList(db.Committees, "CommitteeModelID", "CommitteeName", committeemodel_committeeareaofhealthmodel.CommitteeModelID); return(View(committeemodel_committeeareaofhealthmodel)); }