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); }
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); }
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); }
public bool SetRemark(Miic.Friends.Group.SetRemarkView remarkView) { return(IgroupInfo.SetRemark(remarkView)); }
public bool RemoveMember(string groupID, List <string> members) { return(IgroupInfo.Delete(groupID, members)); }
public int GetInvitingAddressCount(MySimpleGroupSearchView groupSearchView) { return(IgroupInfo.GetInvitingAddresserCount(groupSearchView)); }