示例#1
0
 public ActionResult Edit([Bind(Include = "Id,Description,UserId")] WordGroup wordGroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(wordGroup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(wordGroup));
 }
示例#2
0
        public ActionResult Edit([Bind(Include = "Id,Name,Code")] Language language)
        {
            if (CheckAdminUser() == false)
            {
                return(RedirectToAction("Index", "Home"));
            }

            if (ModelState.IsValid)
            {
                db.Entry(language).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(language));
        }
示例#3
0
 public ActionResult Edit([Bind(Include = "Id,Username,Password,Name")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     if (CheckAdminUser())
     {
         return(View(user));
     }
     else
     {
         return(RedirectToAction("Index", "Home"));
     }
 }