public ActionResult GridViewPartialUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] UserViewModel model)
        {
            string[] selectedRoles = TokenBoxExtension.GetSelectedValues <string>("RoleName");
            var      appUser       = UserManager.FindByEmail(model.Email);
            List <IdentityResult> result;

            if (appUser == null)
            {
                result = CreateUser(new ApplicationUser {
                    UserName = model.UserName, Email = model.Email
                }, selectedRoles);
            }
            else
            {
                result = UpdateUser(appUser, selectedRoles);
            }
            if (result.Any(x => x.Succeeded == false))
            {
                foreach (var item in result.Where(x => x.Succeeded == false))
                {
                    ViewData["Errors"] += item.Errors + ",";
                }
            }
            ViewData["roles"] = GetRoles();
            return(PartialView("_GridViewPartial", GetUsers()));
        }
 public ActionResult EditingUpdate(Person personInfo)
 {
     string[] tokens = TokenBoxExtension.GetSelectedValues <string>("Roles");
     personInfo.Roles = string.Join(",", tokens);
     if (ModelState.IsValid)
     {
         list.UpdatePerson(personInfo);
     }
     FillViewBag();
     return(PartialView("_GridViewEditingPartial", list.GetPersons()));
 }