/// <summary> /// ��Ӻ��� /// </summary> public void AddFriends() { string[] friendIds = Request.Params["friendId"].Split(','); string[] loginNames = Request.Params["loginName"].Split(','); string[] userNames = Request.Params["userName"].Split(','); string[] isOutters = Request.Params["isOutter"].Split(','); string userId = Request.Params["userId"]; string uName = Request.Params["uName"]; string lName = Request.Params["lName"]; string isOutter = Request.Params["iIsOutter"]; Users users = new Users(); try { if (int.Parse(isOutter) == 1) {// ������ⵥλ�û� if (!users.CheckUserExistById(userId.Trim())) {// ����û������ڣ�ע����û� users.RegisterOutter(userId.Trim(), lName.Trim(), uName.Trim()); } else {// �û����ڣ������û�������½����ʹ��������ϵͳ���ݱ���ͬ�� users.ChangeOutter(uName.Trim(), lName.Trim(), userId.Trim()); } } } catch { } string groupId = Request.Params["groupId"]; string groupName = Request.Params["groupName"]; bool flag = true; string tempGroupId = null; for (int i = 0; i < isOutters.Length; i++) { if (int.Parse(isOutters[i]) == 1) {// ������ⵥλ�û� if (!users.CheckUserExistById(friendIds[i].Trim())) {// ����û������ڣ�ע����û� users.RegisterOutter(friendIds[i], loginNames[i], userNames[i]); } else {// �û����ڣ������û�������½����ʹ��������ϵͳ���ݱ���ͬ�� users.ChangeOutter(userNames[i], loginNames[i], friendIds[i]); } } tempGroupId = ChangeUserGroup(userId, friendIds[i], groupName); // ����ҵ��ú��ѵ�İ���˷����� ChangeUserGroup(friendIds[i], userId, "İ����"); if (tempGroupId == null) { flag = false; } else { flag = flag && true; } } if (flag) { WriteMessage(tempGroupId); } else { WriteMessage("0"); } }