public ActionResult DeleteConfirmed(int id) { cardtbl cardtbl = db.cardtbls.Find(id); db.cardtbls.Remove(cardtbl); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "cardid,userid,cardcontent")] cardtbl cardtbl) { if (ModelState.IsValid) { db.Entry(cardtbl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.userid = new SelectList(db.usertbls, "userid", "username", cardtbl.userid); return(View(cardtbl)); }
public ActionResult Create([Bind(Include = "cardid,userid,cardcontent")] cardtbl cardtbl) { if (ModelState.IsValid) { db.cardtbls.Add(cardtbl); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.userid = new SelectList(db.usertbls, "userid", "username", cardtbl.userid); return(View(cardtbl)); }
// GET: crdtbl/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } cardtbl cardtbl = db.cardtbls.Find(id); if (cardtbl == null) { return(HttpNotFound()); } return(View(cardtbl)); }
// GET: crdtbl/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } cardtbl cardtbl = db.cardtbls.Find(id); if (cardtbl == null) { return(HttpNotFound()); } ViewBag.userid = new SelectList(db.usertbls, "userid", "username", cardtbl.userid); return(View(cardtbl)); }