コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Tbl_Bens tbl_Bens = db.Tbl_Bens.Find(id);

            db.Tbl_Bens.Remove(tbl_Bens);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "id,renavam,chassi,placa")] Tbl_Bens tbl_Bens)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_Bens).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_Bens));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "id,renavam,chassi,placa")] Tbl_Bens tbl_Bens)
        {
            if (ModelState.IsValid)
            {
                db.Tbl_Bens.Add(tbl_Bens);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tbl_Bens));
        }
コード例 #4
0
        // GET: Tbl_Bens/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tbl_Bens tbl_Bens = db.Tbl_Bens.Find(id);

            if (tbl_Bens == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_Bens));
        }