示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Db_Type db_type = db.Db_Types.Find(id);

            db.Db_Types.Remove(db_type);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
        //
        // GET: /DbType/Delete/5

        public ActionResult Delete(int id = 0)
        {
            Db_Type db_type = db.Db_Types.Find(id);

            if (db_type == null)
            {
                return(HttpNotFound());
            }
            return(View(db_type));
        }
示例#3
0
 public ActionResult Edit(Db_Type db_type)
 {
     if (ModelState.IsValid)
     {
         db.Entry(db_type).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(db_type));
 }
示例#4
0
        public ActionResult Create(Db_Type db_type)
        {
            if (ModelState.IsValid)
            {
                db.Db_Types.Add(db_type);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(db_type));
        }