public ActionResult DeleteConfirmed(int id) { CTestShare cTestShare = db.CTestShares.Find(id); db.CTestShares.Remove(cTestShare); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "CTestShareID,FCTestID,ShareBy,ShareTo,Password,ShareDate")] CTestShare cTestShare) { if (ModelState.IsValid) { db.Entry(cTestShare).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.FCTestID = new SelectList(db.CTests, "CTestID", "CTNote", cTestShare.FCTestID); return(View(cTestShare)); }
// GET: CTestShare/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CTestShare cTestShare = db.CTestShares.Find(id); if (cTestShare == null) { return(HttpNotFound()); } return(View(cTestShare)); }
// GET: CTestShare/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CTestShare cTestShare = db.CTestShares.Find(id); if (cTestShare == null) { return(HttpNotFound()); } ViewBag.FCTestID = new SelectList(db.CTests, "CTestID", "CTNote", cTestShare.FCTestID); return(View(cTestShare)); }