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

            db.TelevisionSupplierTypes.Remove(televisionSupplierType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "TelevisionSupplierTypeID,Type")] TelevisionSupplierType televisionSupplierType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(televisionSupplierType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(televisionSupplierType));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "TelevisionSupplierTypeID,Type")] TelevisionSupplierType televisionSupplierType)
        {
            if (ModelState.IsValid)
            {
                db.TelevisionSupplierTypes.Add(televisionSupplierType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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