Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            cfgCategory cfgcategory = db.cfgCategory.Find(id);

            db.cfgCategory.Remove(cfgcategory);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Icon,Remark,ParentId,ParentIdList,Sort,State,CreateById,CreateBy,CreateDate,UpdateById,UpdateBy,UpdateDate,BelongId,BelongIds")] cfgCategory cfgcategory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cfgcategory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cfgcategory));
 }
Example #3
0
        // GET: /Home/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            cfgCategory cfgcategory = db.cfgCategory.Find(id);

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