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));
 }
Ejemplo n.º 3
0
 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));
 }
Ejemplo n.º 4
0
 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));
 }
Ejemplo n.º 5
0
        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"));
        }