public JsonResult SaveNewUser(ApplicationUser model, int roleId) { E_Role currentRole = (E_Role)Enum.Parse(typeof(E_Role), ApplicationRole.GetById(roleId).Name); bool isAdded = ApplicationUser.AddNew(model.Email, model.UserName, model.Password, currentRole); if (isAdded) { return(Json(true, JsonRequestBehavior.AllowGet)); } return(Json(false, JsonRequestBehavior.AllowGet)); }