Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            cardtbl cardtbl = db.cardtbls.Find(id);

            db.cardtbls.Remove(cardtbl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        // 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));
        }
Esempio n. 5
0
        // 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));
        }