コード例 #1
0
ファイル: Group.cs プロジェクト: WinHuStudio/iTrip
 public Group(string account, string name, Member[] members)
     : base(GlobalConst.CodeAccountPreFlag_Publisher)
 {
     Account = account;
     Name = name;
     Members.AddRange(members);
 }
コード例 #2
0
        public StandardResult UpdateGroupMember(string account, Member[] ary_str_member, bool isremove)
        {
            if (!ComAcc.IsCommonAccount(account, GlobalConst.CodeAccountPreFlag_Group))
                return Result(iTripExceptionCode.Error_Wrong_Account);

            var resp_group = GetRespository<Group>();
            var group = resp_group.Get(g => g.Account == account);

            if (isremove)
                group.Members.RemoveAll(m => ary_str_member.Any(o => o.Account == m.Account));
            else
            {
                ary_str_member.ForEach(delegate(Member member)
                {
                    if (!group.Members.Exists(m => m.Account == member.Account))
                        group.Members.Add(member);
                });
            }
            resp_group.Save(group);
            return Result();
        }