示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Categorty_Type categorty_Type = db.Categorty_Type.Find(id);

            db.Categorty_Type.Remove(categorty_Type);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "TypeId,Categories")] Categorty_Type categorty_Type)
 {
     if (ModelState.IsValid)
     {
         db.Entry(categorty_Type).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(categorty_Type));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "TypeId,Categories")] Categorty_Type categorty_Type)
        {
            if (ModelState.IsValid)
            {
                db.Categorty_Type.Add(categorty_Type);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(categorty_Type));
        }
示例#4
0
        // GET: Categorty_Type/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Categorty_Type categorty_Type = db.Categorty_Type.Find(id);

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