/// <summary>
 /// 添加用户
 /// </summary>
 /// <param name="returnUrl"></param>
 /// <param name="id"></param>
 /// <param name="keyword"></param>
 /// <param name="userInfo"></param>
 /// <returns></returns>
 public ActionResult Add(string returnUrl, int id, string keyword, UserInfo userInfo, int pagesize, string sortBy, string currentSort)
 {
     DealViewBag("AllUserInfoManage");
     if (userInfo.UserID == 0)
     {
         ModelState.AddModelError("UserIDError", "用户ID不能为空!");
     }
     if (string.IsNullOrEmpty(userInfo.UserName))
     {
         ModelState.AddModelError("UserName", "用户昵称不能为空!");
     }
     AllUserInfoView = updateAllUserInfoViewModel(returnUrl, id, keyword, pagesize, sortBy, currentSort, false);
     if (ModelState.IsValid)
     {
         if (allUserInfo.AddUserInfo(userInfo) == 1)
         {
             TempData["Success"] = "true";
             return(RedirectToAction("index", new { returnUrl, id, keyword, pagesize, sortBy, currentSort }));
         }
         else
         {
             //TempData["Fault"] = "false";
             TempData["Fault"] = "该用户ID已存在!";
             TempData["Modal"] = "AddModal";
             return(View("Index", AllUserInfoView));
         }
     }
     else
     {
         //TempData["Fault"] = "false";
         TempData["Fault"] = "添加失败!";
         TempData["Modal"] = "AddModal";
         return(View("Index", AllUserInfoView));
     }
 }
 /// <summary>
 /// 添加社团团员
 /// </summary>
 /// <param name="gameMember"></param>
 /// <returns></returns>
 public ActionResult Add(GameMember gameMember, int pageID, int pagesize, string keyword, string sortBy, string currentSort, bool CreateAccount = false, bool IsOrderBy = false)
 {
     DealViewBag("GameNumberManage");
     gameMemberViewModel = getGameMemberViewModel(pageID, pagesize, keyword, sortBy, currentSort, IsOrderBy);
     if (ModelState.IsValid)
     {
         if (EFGameMember.addGameMember(gameMember) == 1)
         {
             TempData["Success"] = "添加成功!";
             if (CreateAccount)
             {
                 UserInfo userInfo = new UserInfo
                 {
                     UserID    = gameMember.GameID,
                     PassWord  = gameMember.GameID.ToString(),
                     UserName  = gameMember.GameName,
                     Authority = EFGameMember.gameAuthorities.Count,
                 };
                 EFAllUserInfo.AddUserInfo(userInfo);
             }
             return(RedirectToAction("GameMemberManage", new { pageID, pagesize, keyword, sortBy, currentSort, IsOrderBy }));
         }
         else
         {
             TempData["Fault"] = "添加失败!";
             TempData["Modal"] = "AddModal";
             return(View("GameMemberManage", gameMemberViewModel));
         }
     }
     else
     {
         TempData["Fault"] = "请检查输入!";
         TempData["Modal"] = "AddModal";
         return(View("GameMemberManage", gameMemberViewModel));
     }
 }