예제 #1
0
    public bool AddMember(List <GroupMember> members)
    {
        bool result = false;

        try
        {
            TransactionOptions transactionOptions = new TransactionOptions();
            transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.RepeatableRead;
            transactionOptions.Timeout        = new TimeSpan(0, 1, 0);
            using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, transactionOptions, EnterpriseServicesInteropOption.Automatic))
            {
                try
                {
                    List <GroupMember> tempMembers = IgroupInfo.GetGroupMemberList(members[0].GroupID);
                    foreach (var item in members)
                    {
                        if (tempMembers.Find(m => m.MemberID == item.MemberID) != null)
                        {
                            members.Remove(item);
                        }
                    }
                    result = IgroupInfo.Insert(members[0].GroupID, members);
                    ts.Complete();
                }
                catch (Exception ex)
                {
                    Config.IlogicLogService.Write(new LogicLog()
                    {
                        AppName       = Config.AppName,
                        ClassName     = ClassName,
                        NamespaceName = NamespaceName,
                        MethodName    = MethodBase.GetCurrentMethod().Name,
                        Message       = ex.Message,
                        Oper          = Config.Oper
                    });
                    ts.Dispose();
                }
            }
        }
        catch (Exception ex)
        {
            Config.IlogicLogService.Write(new LogicLog()
            {
                AppName       = Config.AppName,
                ClassName     = ClassName,
                NamespaceName = NamespaceName,
                MethodName    = MethodBase.GetCurrentMethod().Name,
                Message       = ex.Message,
                Oper          = Config.Oper
            });
        }
        return(result);
    }
예제 #2
0
    public string GetInvitingAddressList(MySimpleGroupSearchView groupSearchView, MiicPage page)
    {
        string    result = CommonService.InitialJsonList;
        DataTable dt     = IgroupInfo.GetInvitingAddressList(groupSearchView, page);

        if (dt.Rows.Count > 0)
        {
            var temp = from dr in dt.AsEnumerable()
                       select new
            {
                UserID   = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.AddresserID)],
                UserCode = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.AddresserName)],
                UserName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <SimplePersonUserView, string>(o => o.UserName)],
                UserUrl  = CommonService.GetManageFullUrl(dr[Config.Attribute.GetSqlColumnNameByPropertyName <SimplePersonUserView, string>(o => o.UserUrl)].ToString()),
                Remark   = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.Remark)]
            };
            result = Config.Serializer.Serialize(temp);
        }
        return(result);
    }
예제 #3
0
    public string GetMemberInfoList(string groupID)
    {
        string    result = CommonService.InitialJsonList;
        DataTable dt     = IgroupInfo.GetDetailMemberInfoListByGroupID(groupID);

        if (dt.Rows.Count > 0)
        {
            var temp = from dr in dt.AsEnumerable()
                       select new
            {
                ID         = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupMember, string>(o => o.ID)],
                MemberID   = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupMember, string>(o => o.MemberID)],
                MemberName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupMember, string>(o => o.MemberName)],
                MemberUrl  = CommonService.GetManageFullUrl(dr[Config.Attribute.GetSqlColumnNameByPropertyName <SimplePersonUserView, string>(o => o.UserUrl)].ToString()),
                GroupID    = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupMember, string>(o => o.GroupID)],
                JoinTime   = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupMember, DateTime?>(o => o.JoinTime)],
                Remark     = dr[Config.Attribute.GetSqlColumnNameByPropertyName <SimplePersonUserView, string>(o => o.UserName)].ToString()
            };
            result = Config.Serializer.Serialize(temp);
        }
        return(result);
    }
예제 #4
0
 public bool SetRemark(Miic.Friends.Group.SetRemarkView remarkView)
 {
     return(IgroupInfo.SetRemark(remarkView));
 }
예제 #5
0
 public bool RemoveMember(string groupID, List <string> members)
 {
     return(IgroupInfo.Delete(groupID, members));
 }
예제 #6
0
 public int GetInvitingAddressCount(MySimpleGroupSearchView groupSearchView)
 {
     return(IgroupInfo.GetInvitingAddresserCount(groupSearchView));
 }