示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            FisCode fisCode = db.FisCodes.Find(id);

            db.FisCodes.Remove(fisCode);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,CodeName,FisCategoryId")] FisCode fisCode)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fisCode).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FisCategoryId = new SelectList(db.FisCategories, "Id", "Name", fisCode.FisCategoryId);
     return(View(fisCode));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "Id,CodeName,FisCategoryId")] FisCode fisCode)
        {
            if (ModelState.IsValid)
            {
                db.FisCodes.Add(fisCode);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.FisCategoryId = new SelectList(db.FisCategories, "Id", "Name", fisCode.FisCategoryId);
            return(View(fisCode));
        }
示例#4
0
        // GET: FisCodes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FisCode fisCode = db.FisCodes.Find(id);

            if (fisCode == null)
            {
                return(HttpNotFound());
            }
            return(View(fisCode));
        }
示例#5
0
        // GET: FisCodes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FisCode fisCode = db.FisCodes.Find(id);

            if (fisCode == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FisCategoryId = new SelectList(db.FisCategories, "Id", "Name", fisCode.FisCategoryId);
            return(View(fisCode));
        }