示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SharjCategory sharjcategory = context.SharjCategories.Single(x => x.ID == id);

            context.SharjCategories.Remove(sharjcategory);
            context.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit(SharjCategory sharjcategory)
 {
     if (ModelState.IsValid)
     {
         context.Entry(sharjcategory).State = EntityState.Modified;
         context.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sharjcategory));
 }
示例#3
0
        public ActionResult Create(SharjCategory sharjcategory)
        {
            if (ModelState.IsValid)
            {
                context.SharjCategories.Add(sharjcategory);
                context.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sharjcategory));
        }
示例#4
0
        //
        // GET: /SharjCategory/Delete/5

        public ActionResult Delete(int id)
        {
            SharjCategory sharjcategory = context.SharjCategories.Single(x => x.ID == id);

            return(View(sharjcategory));
        }
示例#5
0
        //
        // GET: /SharjCategory/Details/5

        public ViewResult Details(int id)
        {
            SharjCategory sharjcategory = context.SharjCategories.Single(x => x.ID == id);

            return(View(sharjcategory));
        }