public ActionResult _AddGroupUsers(string id_group, List <string> selected_userGroup_id)
 {
     if (ModelState.IsValid)
     {
         //Getting data to post
         List <GroupUserDTO> groupUserDTOList = new List <GroupUserDTO>();
         foreach (var user_id in selected_userGroup_id)
         {
             GroupUserDTO groupUserDTO = new GroupUserDTO();
             groupUserDTO.id_group = id_group;
             groupUserDTO.user_id  = user_id;
             groupUserDTOList.Add(groupUserDTO);
         }
         //Post
         List <GroupUserDTO> groupUsersAdded = new List <GroupUserDTO>();
         List <GroupUserDTO> groupUserError  = new List <GroupUserDTO>();
         groupUsersAdded = groupProvider.postUsersGroups(groupUserDTOList).Result;
         if (groupUsersAdded.Count != 0)
         {
             //Compare and get not added users
             foreach (var user_added in groupUsersAdded)
             {
                 bool isAdded = false;
                 foreach (var user_id in selected_userGroup_id)
                 {
                     if (user_id == user_added.user_id)
                     {
                         isAdded = true;
                         break;
                     }
                 }
                 if (!isAdded)
                 {
                     groupUserError.Add(user_added);
                     groupUsersAdded.Remove(user_added);
                 }
             }
             // creates a json to return result
             var result = new { usersAdded = groupUsersAdded, usersError = groupUserError, viewHtml = PartialView("/Views/Users/_Group/_GroupUsersList.cshtml", new Model.GroupModel(id_group)).RenderToString() };
             return(Json(result));
         }
     }
     return(new HttpStatusCodeResult(404, "Repeated users"));
 }