public ActionResult Edit([Bind(Include = "Id,Username,Email,Password,ConfirmPassword,UserroleName,UserState,UserDistrict,UserTaluk,UserGramapanchayath,UserVillage,UserId,OperationUnit")] ManageUser manageUser) { if (ModelState.IsValid) { db.Entry(manageUser).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(manageUser)); }
public ActionResult Edit([Bind(Include = "CourseId,CourseName,Domain,Type,Duration,Fee,TrainerName,IsEnabled,CreatedOn,CreatedBy")] CourseDetail courseDetail) { if (ModelState.IsValid) { db.Entry(courseDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(courseDetail)); }
public ActionResult Edit([Bind(Include = "Id,RoleName")] UserRole userRole) { if (ModelState.IsValid) { db.Entry(userRole).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userRole)); }
public ActionResult Edit([Bind(Include = "Id,UserName,FullName,Email,Password,ConfirmPassword,UserImage,Mobile,Role")] UserProfile userProfile) { if (ModelState.IsValid) { db.Entry(userProfile).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Role = new SelectList(db.UserRoles, "Id", "RoleName", userProfile.Role); return(View(userProfile)); }
public ActionResult AssignRole(FormCollection collection) { //string username = collection["UserId"]; //string rolename = collection["Roles"]; int userId = Convert.ToInt32(collection["UserId"]); int roleId = Convert.ToInt32(collection["Roles"]); UserProfile userProfile = new UserProfile(); userProfile = db.UserProfiles.Where(c => c.Id == userId).Select(c => c).First(); userProfile.Role = roleId; if (ModelState.IsValid) { db.Entry(userProfile).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(RedirectToAction("Index")); }