public string Search(MySimpleGroupSearchView searchView, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = IaddressBookInfo.Search(searchView, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() select new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.ID)], AddresserID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.AddresserID)], AddresserName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.AddresserName)], AddresserNickName = dr["NickName"], AddresserUrl = CommonService.GetManageFullUrl(dr[Config.Attribute.GetSqlColumnNameByPropertyName <SimplePersonUserView, string>(o => o.UserUrl)].ToString()), IsBlackList = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.IsBlackList)], CanSeeMe = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.CanSeeMe)], CanSeeMeTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, DateTime?>(o => o.CanSeeMeTime)], CanSeeAddresser = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.CanSeeAddresser)], CanSeeAddresserTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, DateTime?>(o => o.CanSeeAddresserTime)], OftenUsed = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.OftenUsed)], Remark = dr[Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.Remark)] }; result = Config.Serializer.Serialize(temp); } return(result); }
int IGroupInfo.GetInvitingAddresserCount(MySimpleGroupSearchView groupSearchView) { Contract.Requires <ArgumentNullException>(groupSearchView != null, "参数groupSearchView:不能为空"); string message = string.Empty; string sql = string.Empty; int result = 0; sql += "SELECT COUNT(ADDRESSER_ID) FROM ADDRESS_BOOK_INFO"; sql += " inner JOIN SIMPLE_USER_VIEW ON ADDRESS_BOOK_INFO.ADDRESSER_ID = SIMPLE_USER_VIEW.USER_ID "; sql += " WHERE MY_USER_ID = '" + groupSearchView.UserID + "' AND "; sql += " ADDRESSER_ID NOT IN (SELECT MEMBER_ID FROM GROUP_MEMBER WHERE GROUP_ID = '" + groupSearchView.GroupID + "') "; sql += " AND (ADDRESSER_NAME LIKE '%" + groupSearchView.Keyword + "%' OR USER_NAME LIKE '%" + groupSearchView.Keyword + "%')"; try { result = dbService.GetSqlCount(sql, out message); } 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 TrendsSearch(MySimpleGroupSearchView searchView, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = IgroupInfo.TrendsSearch(searchView, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() group dr by new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, string>(o => o.ID)], LogoUrl = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, string>(o => o.LogoUrl)], Name = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, string>(o => o.Name)], MemberCount = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, int?>(o => o.MemberCount)], Manager = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, string>(o => o.CreaterID)] } into g select new { ID = g.Key.ID, LogoUrl = g.Key.LogoUrl, Name = g.Key.Name, MemberCount = g.Key.MemberCount, Manager = g.Key.Manager, TopicInfo = (from item in g.AsEnumerable() select new { Content = item[Config.Attribute.GetSqlColumnNameByPropertyName <TopicShowInfo, string>(o => o.TopicContent)], CreaterID = item["TopicCreaterID"], CreaterName = item["TopicCreaterName"], RealName = item["REAL_NAME"], IsFriend = item["IS_FRIEND"], CreaterUrl = CommonService.GetManageFullUrl(item[Config.Attribute.GetSqlColumnNameByPropertyName <TopicShowInfo, string>(o => o.CreaterUrl)].ToString()), CreateTime = item["TopicCreateTime"], MessageCount = item[Config.Attribute.GetSqlColumnNameByPropertyName <TopicShowInfo, int?>(o => o.MessageCount)] }).Take(10) }; result = Config.Serializer.Serialize(temp); } return(result); }
DataTable IGroupInfo.GetInvitingAddressList(MySimpleGroupSearchView groupSearchView, MiicPage page) { Contract.Requires <ArgumentNullException>(groupSearchView != null, "参数groupSearchView:不能为空"); string message = string.Empty; string sql = string.Empty; DataTable result = new DataTable(); sql += "SELECT ADDRESSER_ID,ADDRESSER_NAME,REMARK,USER_NAME,MICRO_USER_URL FROM ADDRESS_BOOK_INFO"; sql += " inner JOIN SIMPLE_USER_VIEW ON ADDRESS_BOOK_INFO.ADDRESSER_ID = SIMPLE_USER_VIEW.USER_ID "; sql += " WHERE MY_USER_ID = '" + groupSearchView.UserID + "' AND "; sql += " ADDRESSER_ID NOT IN (SELECT MEMBER_ID FROM GROUP_MEMBER WHERE GROUP_ID = '" + groupSearchView.GroupID + "') "; sql += " AND (ADDRESSER_NAME LIKE '%" + groupSearchView.Keyword + "%' OR USER_NAME LIKE '%" + groupSearchView.Keyword + "%')"; if (page != null) { sql = "WITH LIST_PAGE AS ( SELECT ROW_NUMBER() OVER (ORDER BY TEMP.USER_NAME ASC) AS row, TEMP.* FROM ( " + sql; sql += " ) AS TEMP ) "; sql += " SELECT * FROM LIST_PAGE WHERE row BETWEEN " + page.pageStart + " AND " + page.pageEnd; } try { result = dbService.querySql(sql, out message); } 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 Search(MySimpleGroupSearchView searchView, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = IgroupInfo.Search(searchView, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() select new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, string>(o => o.ID)], Name = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, string>(o => o.Name)], LogoUrl = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, string>(o => o.LogoUrl)], MemberCount = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, int?>(o => o.MemberCount)], CreaterID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, string>(o => o.CreaterID)], CreaterName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, string>(o => o.CreaterName)], CreateTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupInfo, DateTime?>(o => o.CreateTime)], GroupMemberID = dr["GroupMemberID"], Remark = dr[Config.Attribute.GetSqlColumnNameByPropertyName <GroupMember, string>(o => o.Remark)].ToString() }; result = Config.Serializer.Serialize(temp); } return(result); }
public int GetBlackListSearchCount(MySimpleGroupSearchView searchView) { return(IaddressBookInfo.GetPersonBlackListCount(searchView)); }
public int GetSearchCount(MySimpleGroupSearchView searchView) { return(IaddressBookInfo.GetSearchCount(searchView)); }
public int GetTrendsSearchCount(MySimpleGroupSearchView searchView) { return(IgroupInfo.GetTrendsSearchCount(searchView)); }
public int GetInvitingAddressCount(MySimpleGroupSearchView groupSearchView) { return(IgroupInfo.GetInvitingAddresserCount(groupSearchView)); }