public ActionResult EditUser([Bind(Include = "UserId,UserNo,Active,Name,UserName,Password,Type_id")] User user) { if (ModelState.IsValid) { u.UpdateUser(user); u.CommitUser(); return(RedirectToAction("UserIndex")); } ViewBag.Type_id = new SelectList(t.GetTypes(), "Id", "type1", user.Type_id); return(View(user)); }
public ActionResult Edit(User u) { if (u != null) { if (iuser.UpdateUser(u) == true) { iuser.Commit(); } else { ViewBag.DuplicateMessage = "username already exists"; return(View(u)); } } return(RedirectToAction("Index")); }