public string GetMessageInfoList(string topicID, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = ImessageInfo.GetMessageListByTopicID(topicID, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() select new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.ID)], TopicID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.TopicID)], Content = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.Content)], FromCommenterID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.FromCommenterID)], FromCommenterName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.FromCommenterName)], FromCommenterUrl = CommonService.GetManageFullUrl(dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.FromCommenterUrl)].ToString()), FromCommenterRealName = dr["FROM_USER_REAL_NAME"].ToString(), FromCommenterIsFriend = dr["FROM_USER_IS_FRIEND"].ToString(), ToCommenterID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.ToCommenterID)], ToCommenterName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.ToCommenterName)], ToCommenterUrl = Convert.IsDBNull(dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.ToCommenterUrl)]) == true ? string.Empty : CommonService.GetManageFullUrl(dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.ToCommenterUrl)].ToString()), CommentTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.Group.MessageInfo, DateTime?>(o => o.CommentTime)], ToCommenterRealName = dr["TO_USER_REAL_NAME"].ToString(), ToCommenterIsFriend = dr["TO_USER_IS_FRIEND"].ToString() }; result = Config.Serializer.Serialize(temp); } return(result); }
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); }
public string GetCommentInfos(string publishID, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = ((CommentInfoDao)IcommentInfo).GetCommentList(publishID, page); if (dt != null && dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() select new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, string>(o => o.ID)].ToString(), PublishID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, string>(o => o.PublishID)].ToString(), Content = dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, string>(o => o.Content)].ToString(), FromCommenterID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, string>(o => o.FromCommenterID)].ToString(), FromCommenterName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, string>(o => o.FromCommenterName)].ToString(), FromCommenterUrl = CommonService.GetManageFullUrl(dr["FROM_USER_URL"].ToString()), FromCommenterType = dr["FROM_USER_TYPE"].ToString(), FromCommenterRemark = dr["FROM_USER_REMARK"].ToString(), FromCommenterRealName = dr["FROM_USER_REAL_NAME"].ToString(), FromCommenterIsFriend = dr["FROM_USER_IS_FRIEND"].ToString(), CommentTime = (DateTime?)dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, DateTime?>(o => o.CommentTime)], ToCommenterID = Convert.IsDBNull(dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, string>(o => o.ToCommenterID)]) ? string.Empty : dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, string>(o => o.ToCommenterID)].ToString(), ToCommenterName = Convert.IsDBNull(dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, string>(o => o.ToCommenterName)]) ? string.Empty : dr[Config.Attribute.GetSqlColumnNameByPropertyName <CommentInfo, string>(o => o.ToCommenterName)].ToString(), ToCommenterUrl = CommonService.GetManageFullUrl(dr["TO_USER_URL"].ToString()), ToCommenterType = dr["TO_USER_TYPE"].ToString(), ToCommenterRemark = dr["TO_USER_REMARK"].ToString(), ToCommenterRealName = dr["TO_USER_REAL_NAME"].ToString(), ToCommenterIsFriend = dr["TO_USER_IS_FRIEND"].ToString() }; result = Config.Serializer.Serialize(temp); } return(result); }
public string SearchFriends(MyKeywordView keywordView, MiicPage page) { string result = CommonService.InitialJsonList; Miic.Friends.User.IUserInfo IuserInfo = new Miic.Friends.User.UserInfoDao(); DataTable dt = IuserInfo.Search(keywordView, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() select new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.UserID)], UserType = dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.UserType)], UserName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.UserName)], RealName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.RealName)], Sex = dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.Sex)], OrgName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.OrgName)], UserUrl = CommonService.GetManageFullUrl(dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.UserUrl)].ToString()), IsMyFriend = Convert.IsDBNull(dr["ADDRESS_BOOK_" + Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.ID)]) == false || (!string.IsNullOrEmpty(this.UserID) && dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.UserID)].ToString() == this.UserID) ? true : false }; result = Config.Serializer.Serialize(temp); } return(result); }
public DataTable Search(GeneralSimpleGroupSearchView searchView, MiicPage page) { Contract.Requires <ArgumentNullException>(searchView != null, "参数searchView:不能为空"); DataTable result = new DataTable(); string message = string.Empty; MiicConditionCollections conditions = searchView.visitor(this); MiicCondition isBlackListCondition = new MiicCondition(Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.IsBlackList), ((int)MiicYesNoSetting.No).ToString(), DbType.String, MiicDBOperatorSetting.Equal); conditions.Add(new MiicConditionLeaf(isBlackListCondition)); List <MiicOrderBy> order = new List <MiicOrderBy>(); order.Add(new MiicOrderBy() { Desc = true, PropertyName = Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.AddresserName) }); order.Add(new MiicOrderBy() { Desc = true, PropertyName = Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.OftenUsed) }); conditions.order = order; MiicRelation relation = new MiicRelation(Config.Attribute.GetSqlTableNameByClassName <AddressBookInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.AddresserID), Config.Attribute.GetSqlTableNameByClassName <Miic.Friends.User.SimpleUserView>(), Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.UserID), MiicDBOperatorSetting.Equal, MiicDBRelationSetting.InnerJoin); MiicColumnCollections columns = new MiicColumnCollections(); MiicColumn addressBookInfoColumns = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <AddressBookInfo>()); columns.Add(addressBookInfoColumns); MiicColumn ImageUrlColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <Miic.Friends.User.SimpleUserView>(), Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.UserUrl)); columns.Add(ImageUrlColumn); MiicColumn NickNameColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <Miic.Friends.User.SimpleUserView>(), "", Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.User.SimpleUserView, string>(o => o.UserName), "NickName"); columns.Add(NickNameColumn); if (page != null) { result = dbService.GetInformationsPage(columns, relation, conditions, page, out message); } else { result = dbService.GetInformations(columns, relation, conditions, out message); } return(result); }
public string GetPublishInfosByLabel(string labelID, MiicPage page) { string result = CommonService.InitialJsonObject; DataTable dt = new DataTable(); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() group dr by new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.ID)], Title = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.Title)], Content = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.Content)], CreaterID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.CreaterID)], CreaterName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.CreaterName)], CreateTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, DateTime?>(o => o.CreateTime)], HasAcc = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.HasAcc)], PraiseNum = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.PraiseNum)], TreadNum = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.TreadNum)], TransmitNum = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.TransmitNum)], ReportNum = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.ReportNum)], CommentNum = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.CommentNum)] } into g select new { ID = g.Key.ID, Title = g.Key.Title, Content = g.Key.Content, CreaterID = g.Key.CreaterID, CreaterName = g.Key.CreaterName, CreateTime = g.Key.CreateTime, HasAcc = g.Key.HasAcc, PraiseNum = g.Key.PraiseNum, TreadNum = g.Key.TreadNum, TransmitNum = g.Key.TransmitNum, ReportNum = g.Key.ReportNum, CommentNum = g.Key.CommentNum, FileList = g.Key.HasAcc.ToString() == ((int)MiicYesNoSetting.No).ToString() ? null : (from item in g.AsEnumerable() select new { Name = item[Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.FileName)], Path = item[Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.FilePath)], FileType = item[Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.FileType)] }) }; } return(result); }
public string TopicSearch(TopicSearchView searchView, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = ImessageInfo.Search(searchView, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() group dr by new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <TopicInfo, string>(o => o.ID)], Content = dr[Config.Attribute.GetSqlColumnNameByPropertyName <TopicInfo, string>(o => o.TopicContent)], MessageCount = dr[Config.Attribute.GetSqlColumnNameByPropertyName <TopicInfo, int?>(o => o.MessageCount)], CreateTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <TopicInfo, DateTime?>(o => o.CreateTime)], CreaterID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <TopicInfo, string>(o => o.CreaterID)], CreaterName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <TopicInfo, string>(o => o.CreaterName)] } into g select new { ID = g.Key.ID, Content = g.Key.Content, MessageCount = g.Key.MessageCount, CreateTime = g.Key.CreateTime, CreaterID = g.Key.CreaterID, CreaterName = g.Key.CreaterName, MessageInfoList = g.Count(o => Convert.IsDBNull(o["MessageID"]) == false) == 0 ? null : (from item in g.AsEnumerable() select new { Content = item[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.Content)], FromCommenterID = item[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.FromCommenterID)], FromCommenterName = item[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.FromCommenterName)], FromCommenterUrl = CommonService.GetManageFullUrl(item[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.FromCommenterUrl)].ToString()), FromCommenterRealName = item["FROM_COMMENTER_REAL_NAME"].ToString(), FromCommenterIsFriend = item["FROM_COMMENTER_IS_FRIEND"].ToString(), ToCommenterID = item[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.ToCommenterID)], ToCommenterName = item[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.ToCommenterName)], ToCommenterUrl = Convert.IsDBNull(item[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.ToCommenterUrl)]) == true ? string.Empty : CommonService.GetManageFullUrl(item[Config.Attribute.GetSqlColumnNameByPropertyName <MessageShowInfo, string>(o => o.ToCommenterUrl)].ToString()), CommentTime = item[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Friends.Group.MessageInfo, DateTime?>(o => o.CommentTime)], ToCommenterRealName = item["TO_COMMENTER_REAL_NAME"].ToString(), ToCommenterIsFriend = item["TO_COMMENTER_IS_FRIEND"].ToString() }).Take(10) }; result = Config.Serializer.Serialize(temp); } return(result); }
DataTable IMessageInfo.Search(TopicSearchView searchView, MiicPage page) { Contract.Requires <ArgumentNullException>(searchView != null, "参数searchView:不能为空"); DataTable result = new DataTable(); string message = string.Empty; try { if (page == null) { Dictionary <String, String> paras = new Dictionary <String, String>(); paras.Add("USER_ID", searchView.UserID); paras.Add("COMMUNITY_ID", searchView.CommunityID); paras.Add("KEYWORD", searchView.Keyword); paras.Add("PAGE_START", string.Empty); paras.Add("PAGE_END", string.Empty); string storeProcedureName = "SearchCommunityTopic"; result = dbService.QueryStoredProcedure <string>(storeProcedureName, paras, out message); } else { Dictionary <String, String> paras = new Dictionary <String, String>(); paras.Add("USER_ID", searchView.UserID); paras.Add("COMMUNITY_ID", searchView.CommunityID); paras.Add("KEYWORD", searchView.Keyword); paras.Add("PAGE_START", page.pageStart); paras.Add("PAGE_END", page.pageEnd); string storeProcedureName = "SearchCommunityTopic"; result = dbService.QueryStoredProcedure <string>(storeProcedureName, paras, 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); }
/// <summary> /// 获取行业圈子信息的所有评论 /// </summary> /// <param name="publishID">行业圈子信息ID</param> /// <param name="page">分页</param> /// <returns>行业圈子信息评论列表</returns> public DataTable GetCommentList(string publishID, MiicPage page) { DataTable result = new DataTable(); MiicColumnCollections column = new MiicColumnCollections(); List <MiicOrderBy> orders = new List <MiicOrderBy>(); string message = string.Empty; string sql = string.Empty; Cookie cookie = new Cookie(); string UserID = cookie.GetCookie("MiicID", out message); if (string.IsNullOrEmpty(UserID)) { throw new Miic.MiicException.MiicCookieArgumentNullException("UserID不能为空,Cookie失效"); } sql += "SELECT * FROM GetCommunityCommentListWithAddress('" + UserID + "','" + publishID + "') "; if (page != null) { sql = "WITH INFO_PAGE AS ( SELECT row_number() OVER ( ORDER BY Temp.COMMENT_TIME DESC) as row,Temp.* FROM ( " + sql; sql += " ) as Temp) "; sql += "SELECT * FROM INFO_PAGE where row between " + page.pageStart + " and " + page.pageEnd + ";"; } else { sql += " ORDER BY COMMENT_TIME DESC"; } 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); }
DataTable IUserInfo.Search(KeywordView keywordView, MiicPage page) { Contract.Requires <ArgumentNullException>(keywordView != null, "参数keywordView:不能为空"); DataTable result = new DataTable(); string message = string.Empty; string sql = string.Empty; string contentSql = "select " + Config.Attribute.GetSqlTableNameByClassName <SimpleUserView>() + ".* ,TEMP_ADDRESS_BOOK_INFO.ID as ADDRESS_BOOK_ID"; contentSql += " from " + Config.Attribute.GetSqlTableNameByClassName <SimpleUserView>() + " left join (select ID,ADDRESSER_ID from " + Config.Attribute.GetSqlTableNameByClassName <AddressBookInfo>(); contentSql += " where (" + Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.MyUserID) + " = '" + keywordView.userID + "')) as TEMP_ADDRESS_BOOK_INFO "; contentSql += " on " + Config.Attribute.GetSqlColumnNameByPropertyNameWithTable <SimpleUserView, string>(o => o.UserID) + "=TEMP_ADDRESS_BOOK_INFO." + Config.Attribute.GetSqlColumnNameByPropertyName <AddressBookInfo, string>(o => o.AddresserID); contentSql += " where (" + Config.Attribute.GetSqlColumnNameByPropertyName <SimpleUserView, string>(o => o.UserName) + " like '%" + keywordView.Keyword + "%') "; contentSql += " and SIMPLE_USER_VIEW.USER_ID in (select ID from MIIC_SOCIAL_COMMON.dbo.MIIC_SOCIAL_USER where CAN_SEARCH = '" + ((int)MiicYesNoSetting.Yes).ToString() + "') "; try { if (page != null) { sql = "with INFO_PAGE as ( select row_number() over ( ORDER BY Temp.USER_NAME ASC) as row,Temp.* from ( "; sql += contentSql; sql += ") as Temp)"; sql += "select * from INFO_PAGE where row between " + page.pageStart + " and " + page.pageEnd; } else { sql = contentSql; } 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 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 Search(MyNoticeView myNoticeView, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = ImessageInfo.GetMyNoticeInfoList(myNoticeView, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() select new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, string>(o => o.ID)], PublishID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, string>(o => o.PublishID)], Source = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, string>(o => o.Source)], UserID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, string>(o => o.PublisherID)], UserName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, string>(o => o.PublisherName)], PublishTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, DateTime?>(o => o.PublishTime)] }; 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); }
public string Search(MyNoticeView myNoticeView, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = InoticeInfo.GetMyNoticeInfoList(myNoticeView, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() select new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <NoticeShowInfo, string>(o => o.ID)], PublishID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <NoticeShowInfo, string>(o => o.ShowID)], Source = dr[Config.Attribute.GetSqlColumnNameByPropertyName <NoticeShowInfo, string>(o => o.Source)], Content = dr[Config.Attribute.GetSqlColumnNameByPropertyName <NoticeShowInfo, string>(o => o.Content)], PublishType = dr[Config.Attribute.GetSqlColumnNameByPropertyName <NoticeShowInfo, string>(o => o.PublishType)], UserID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <NoticeShowInfo, string>(o => o.PublisherID)], UserName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <NoticeShowInfo, string>(o => o.PublisherName)], UserUrl = CommonService.GetManageFullUrl(dr[Config.Attribute.GetSqlColumnNameByPropertyName <MiicSocialUserInfo, string>(o => o.MicroUserUrl)].ToString()), PublishTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <NoticeShowInfo, DateTime?>(o => o.PublishTime)] }; result = Config.Serializer.Serialize(temp); } 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); }
/// <summary> /// 获取朋友圈信息的所有评论 /// </summary> /// <param name="commentSearchView">评论查询视图</param> /// <param name="page">分页</param> /// <returns>朋友圈信息评论列表</returns> public DataTable GetCommentList(CommentSearchView commentSearchView, MiicPage page) { DataTable result = new DataTable(); MiicColumnCollections column = new MiicColumnCollections(); List <MiicOrderBy> orders = new List <MiicOrderBy>(); string message = string.Empty; string sql = string.Empty; sql += "SELECT * FROM GetCommentListWithAddress('" + commentSearchView.UserID + "','" + commentSearchView.PublishID + "') "; if (page != null) { sql = "WITH INFO_PAGE AS ( SELECT row_number() OVER ( ORDER BY Temp.COMMENT_TIME DESC) as row,Temp.* FROM ( " + sql; sql += " ) as Temp) "; sql += "SELECT * FROM INFO_PAGE where row between " + page.pageStart + " and " + page.pageEnd + ";"; } else { sql += " ORDER BY COMMENT_TIME DESC"; } try { //if (commentSearchView.WithAddress == MiicYesNoSetting.No) //{ result = dbService.querySql(sql, out message); //} //else //{ // if (page == null) // { // Dictionary<String, String> paras = new Dictionary<String, String>(); // paras.Add("PUBLISH_ID", commentSearchView.PublishID); // paras.Add("USER_ID", commentSearchView.UserID); // paras.Add("PAGE_START", string.Empty); // paras.Add("PAGE_END", string.Empty); // string storeProcedureName = "GetAddressMomentsComment"; // result = dbService.QueryStoredProcedure<string>(storeProcedureName, paras, out message); // } // else // { // Dictionary<String, String> paras = new Dictionary<String, String>(); // paras.Add("PUBLISH_ID", commentSearchView.PublishID); // paras.Add("USER_ID", commentSearchView.UserID); // paras.Add("PAGE_START", page.pageStart); // paras.Add("PAGE_END", page.pageEnd); // string storeProcedureName = "GetAddressMomentsComment"; // result = dbService.QueryStoredProcedure<string>(storeProcedureName, paras, 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 LabelSearch(Miic.Friends.Community.NoPersonKeywordView keywordView, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = IlabelInfo.Search(keywordView, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() group dr by new { ID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, string>(o => o.ID)], Name = dr[Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, string>(o => o.LabelName)], CommunityID = keywordView.CommunityID, CreaterID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, string>(o => o.CreaterID)], CreaterName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, string>(o => o.CreaterName)], CreateTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, DateTime?>(o => o.CreateTime)] } into g select new { ID = g.Key.ID, Name = g.Key.Name, CommunityID = g.Key.CommunityID, CreaterID = g.Key.CreaterID, CreaterName = g.Key.CreaterName, CreateTime = g.Key.CreateTime, PublishCount = (from item in g.AsEnumerable() where Convert.IsDBNull(item[Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(u => u.PublishID)]) == false select new { PublishID = item[Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.PublishID)] }).Distinct().Count(), UserList = g.Count(o => Convert.IsDBNull(o[Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(u => u.PublishID)]) == false) == 0 ? null : (from item in g.AsEnumerable() select new { UserID = item[Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.UserID)], UserName = item[Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.UserName)], UserType = item[Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.UserType)], UserUrl = CommonService.GetManageFullUrl(item[Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.UserUrl)].ToString()) }).Distinct().Take(14) }; result = Config.Serializer.Serialize(temp); } return(result); }
public string GetCollectInfos(MyKeywordView keywordView, MiicPage page) { string result = CommonService.InitialJsonList; DataTable dt = ((CollectInfoDao)IcollectInfo).GetCollectInfos(keywordView, page); if (dt.Rows.Count > 0) { var temp = from dr in dt.AsEnumerable() group dr by new { ID = dr["CommunityCollectInfo" + Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, string>(o => o.ID)].ToString(), PublishInfoID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.ID)].ToString(), Title = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.Title)].ToString(), DetailContent = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.Content)].ToString(), Content = CommonService.DelImgStr(dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.PublishType)].ToString(), dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.Content)].ToString(), false), CreaterID = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.CreaterID)].ToString(), CreaterName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.CreaterName)].ToString(), CreaterOrgName = dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Manage.User.SimplePersonUserView, string>(o => o.OrgName)].ToString(), CreaterUserUrl = CommonService.GetManageFullUrl(dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Manage.User.SimplePersonUserView, string>(o => o.UserUrl)].ToString()), CreaterUserType = dr[Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Manage.User.SimplePersonUserView, string>(o => o.UserType)].ToString(), CreateTime = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, DateTime?>(o => o.CreateTime)], EditStatus = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.EditStatus)].ToString(), PublishTime = (DateTime?)dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, DateTime?>(o => o.PublishTime)], PublishType = dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.PublishType)].ToString(), BrowseNum = (int?)dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.BrowseNum)], PraiseNum = (int?)dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.PraiseNum)], TreadNum = (int?)dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.TreadNum)], TransmitNum = (int?)dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.TransmitNum)], CollectNum = (int?)dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.CollectNum)], CommentNum = (int?)dr[Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, int?>(o => o.CommentNum)] } into g select new { ID = g.Key.ID, PublishInfoID = g.Key.PublishInfoID, Title = g.Key.Title, DetailContent = g.Key.DetailContent, Content = g.Key.Content, CreaterID = g.Key.CreaterID, CreaterName = g.Key.CreaterName, CreaterOrgName = g.Key.CreaterOrgName, CreaterUserUrl = g.Key.CreaterUserUrl, CreaterUserType = g.Key.CreaterUserType, CreateTime = g.Key.CreateTime, EditStatus = g.Key.EditStatus, PublishTime = g.Key.PublishTime, PublishType = g.Key.PublishType, BrowseNum = g.Key.BrowseNum, PraiseNum = g.Key.PraiseNum, TreadNum = g.Key.TreadNum, TransmitNum = g.Key.TransmitNum, CollectNum = g.Key.CollectNum, IsCollect = (from item in g.AsParallel() where Convert.IsDBNull(item[Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, string>(o => o.CollectorID)]) == false && item[Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, string>(o => o.CollectorID)].ToString() == UserID select new { CollectorID = item[Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, string>(o => o.CollectorID)].ToString() }).Distinct().Count() == 0 ? false : true, AccInfos = (from item in g where Convert.IsDBNull(item["CommunityAccessoryInfo" + Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.ID)]) == false select new { MicroAccessoryInfoID = item["CommunityAccessoryInfo" + Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.ID)].ToString(), FileName = item[Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.FileName)].ToString(), FilePath = item[Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.FilePath)].ToString(), UploadTime = (DateTime?)item[Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, DateTime?>(o => o.UploadTime)], FileType = item[Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.FileType)].ToString() }).Distinct() }; result = Config.Serializer.Serialize(temp); } return(result); }
DataTable ILabelInfo.Search(NoPersonKeywordView keywordView, MiicPage page) { Contract.Requires <ArgumentNullException>(keywordView != null, "参数keywordView:不为空!"); DataTable result = new DataTable(); string message = string.Empty; MiicConditionCollections condition = keywordView.visitor(this); MiicRelation relation = new MiicRelation(Config.Attribute.GetSqlTableNameByClassName <LabelInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, string>(o => o.ID), Config.Attribute.GetSqlTableNameByClassName <LabelSearchInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.LabelID), MiicDBOperatorSetting.Equal, MiicDBRelationSetting.LeftJoin); MiicColumnCollections columns = new MiicColumnCollections(); MiicColumn labelIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, string>(o => o.ID)); columns.Add(labelIDColumn); MiicColumn labelNameColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, string>(o => o.LabelName)); columns.Add(labelNameColumn); MiicColumn createTimeColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, DateTime?>(o => o.CreateTime)); columns.Add(createTimeColumn); MiicColumn createrIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, string>(o => o.CreaterID)); columns.Add(createrIDColumn); MiicColumn createrNameColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, string>(o => o.CreaterName)); columns.Add(createrNameColumn); MiicColumn sortNoColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelInfo, int?>(o => o.SortNo)); columns.Add(sortNoColumn); MiicColumn labelSearchPublishIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelSearchInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.PublishID)); columns.Add(labelSearchPublishIDColumn); MiicColumn labelSearchUserIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelSearchInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.UserID)); columns.Add(labelSearchUserIDColumn); MiicColumn labelSearchUserNameColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelSearchInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.UserName)); columns.Add(labelSearchUserNameColumn); MiicColumn labelSearchUserTypeColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelSearchInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.UserType)); columns.Add(labelSearchUserTypeColumn); MiicColumn labelSearchUserUrlColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <LabelSearchInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <LabelSearchInfo, string>(o => o.UserUrl)); columns.Add(labelSearchUserUrlColumn); try { if (page != null) { List <MiicOrderBy> order = new List <MiicOrderBy>(); order.Add(new MiicOrderBy() { Desc = true, PropertyName = Config.Attribute.GetSqlColumnNameByPropertyNameWithTable <LabelInfo, int?>(o => o.SortNo) }); condition.order = order; result = dbService.GetInformationsPage(columns, relation, condition, page, out message, MiicDBPageRowNumberSetting.DenseRank); } else { result = dbService.GetInformations(columns, relation, condition, 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); }
/// <summary> /// 获取用户关注过的行业圈子信息列表提示 /// </summary> /// <param name="keywordView">关键字视图</param> /// <param name="page">分页</param> /// <returns>行业圈子信息提示列表</returns> public DataTable GetHintedBrowseList(MyKeywordView keywordView, MiicPage page) { Contract.Requires <ArgumentNullException>(keywordView != null, "参数keywordView:不能为空"); DataTable result = new DataTable(); string message = string.Empty; MiicConditionCollections condition = keywordView.visitor(this); MiicRelation relation = new MiicRelation(Config.Attribute.GetSqlTableNameByClassName <BrowseInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <BrowseInfo, string>(o => o.PublishID), Config.Attribute.GetSqlTableNameByClassName <PublishInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.ID), MiicDBOperatorSetting.Equal, MiicDBRelationSetting.LeftJoin); MiicColumnCollections columns = new MiicColumnCollections(); MiicColumn browseIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <BrowseInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <BrowseInfo, string>(o => o.ID)); columns.Add(browseIDColumn); MiicColumn browserIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <BrowseInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <BrowseInfo, string>(o => o.BrowserID)); columns.Add(browserIDColumn); MiicColumn browserNameColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <BrowseInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <BrowseInfo, string>(o => o.BrowserName)); columns.Add(browserNameColumn); MiicColumn publishIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <BrowseInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <BrowseInfo, string>(o => o.PublishID)); columns.Add(publishIDColumn); MiicColumn microTitleColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <PublishInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.Title)); columns.Add(microTitleColumn); MiicColumn microContentColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <PublishInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.Content)); columns.Add(microContentColumn); MiicColumn microTypeColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <PublishInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.PublishType)); columns.Add(microTypeColumn); try { if (page == null) { DataTable dt = dbService.GetInformations(columns, relation, condition, out message); DataView dtView = dt.DefaultView; result = dtView.ToTable(true); } else { DataTable dtWithPage = dbService.GetInformationsPage(columns, relation, condition, page, out message); DataView dtWithPageView = dtWithPage.DefaultView; result = dtWithPageView.ToTable(true); } } 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); }
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); }
/// <summary> /// 获得企业留言列表 /// </summary> /// <param name="orgID">企业ID</param> /// <param name="page">分页</param> /// <returns>留言列表信息</returns> public DataTable GetOrgCommentInfos(string orgID, MiicPage page) { Contract.Requires <ArgumentNullException>(!string.IsNullOrEmpty(orgID), "参数orgID:不能为空"); DataTable result = new DataTable(); string message = string.Empty; MiicRelationCollections relation = new MiicRelationCollections(Config.Attribute.GetSqlTableNameByClassName <OrgCommentInfo>()); MiicFriendRelation fromRelation = new MiicFriendRelation(Config.Attribute.GetSqlColumnNameByPropertyName <OrgCommentInfo, string>(o => o.FromCommenterID), new MiicTableName() { TableAliasName = "FROM_USER", TableName = Config.Attribute.GetSqlTableNameByClassName <MiicSocialUserInfo>() }, Config.Attribute.GetSqlColumnNameByPropertyName <MiicSocialUserInfo, string>(o => o.ID), MiicDBOperatorSetting.Equal, MiicDBRelationSetting.LeftJoin); relation.Add(fromRelation); MiicFriendRelation toRelation = new MiicFriendRelation(Config.Attribute.GetSqlColumnNameByPropertyName <OrgCommentInfo, string>(o => o.ToCommenterID), new MiicTableName() { TableAliasName = "TO_USER", TableName = Config.Attribute.GetSqlTableNameByClassName <MiicSocialUserInfo>() }, Config.Attribute.GetSqlColumnNameByPropertyName <MiicSocialUserInfo, string>(o => o.ID), MiicDBOperatorSetting.Equal, MiicDBRelationSetting.LeftJoin); relation.Add(toRelation); MiicCondition orgIDCondition = new MiicCondition(Config.Attribute.GetSqlColumnNameByPropertyName <OrgCommentInfo, string>(o => o.OrgID), orgID, DbType.String, MiicDBOperatorSetting.Equal); MiicConditionCollections conditions = new MiicConditionCollections(); conditions.Add(new MiicConditionLeaf(MiicDBLogicSetting.No, orgIDCondition)); List <MiicOrderBy> order = new List <MiicOrderBy>(); MiicOrderBy timeOrder = new MiicOrderBy() { Desc = true, PropertyName = Config.Attribute.GetSqlColumnNameByPropertyName <OrgCommentInfo, DateTime?>(o => o.CommentTime) }; order.Add(timeOrder); conditions.order = order; MiicColumn allColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <OrgCommentInfo>()); MiicColumnCollections column = new MiicColumnCollections(); column.Add(allColumn); MiicColumn fromUserUrlColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <MiicSocialUserInfo>(), "FROM_USER", Config.Attribute.GetSqlColumnNameByPropertyName <MiicSocialUserInfo, string>(o => o.MicroUserUrl), "FROM_USER_URL"); column.Add(fromUserUrlColumn); MiicColumn fromUserTypeColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <MiicSocialUserInfo>(), "FROM_USER", Config.Attribute.GetSqlColumnNameByPropertyName <MiicSocialUserInfo, string>(o => o.UserType), "FROM_USER_TYPE"); column.Add(fromUserTypeColumn); MiicColumn toUserUrlColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <MiicSocialUserInfo>(), "TO_USER", Config.Attribute.GetSqlColumnNameByPropertyName <MiicSocialUserInfo, string>(o => o.MicroUserUrl), "TO_USER_URL"); column.Add(toUserUrlColumn); MiicColumn toUserTypeColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <MiicSocialUserInfo>(), "TO_USER", Config.Attribute.GetSqlColumnNameByPropertyName <MiicSocialUserInfo, string>(o => o.UserType), "TO_USER_TYPE"); column.Add(toUserTypeColumn); try { if (page == null) { result = dbService.GetInformations(column, relation, conditions, out message); } else { result = dbService.GetInformationsPage(column, relation, conditions, page, 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); }
/// <summary> /// 我的收藏信息列表 /// </summary> /// <param name="keywordView">关键字视图</param> /// <param name="orderView">排序视图</param> /// <param name="page">分页</param> /// <returns>收藏信息列表</returns> public DataTable GetCollectInfos(MyKeywordView keywordView, MiicPage page) { Contract.Requires <ArgumentNullException>(keywordView != null, "参数keywordView:不能为空"); DataTable result = new DataTable(); string message = string.Empty; List <MiicOrderBy> orders = new List <MiicOrderBy>(); MiicColumnCollections column = new MiicColumnCollections(); MiicConditionCollections condition = keywordView.visitor(this); MiicOrderBy collectOrder = new MiicOrderBy() { Desc = true, PropertyName = Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, DateTime?>(o => o.CollectTime) }; orders.Add(collectOrder); condition.order = orders; MiicFriendRelation collectRelation = new MiicFriendRelation(Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.ID), Config.Attribute.GetSqlTableNameByClassName <CollectInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, string>(o => o.PublishID), MiicDBOperatorSetting.Equal, MiicDBRelationSetting.InnerJoin); MiicFriendRelation accRelation = new MiicFriendRelation(Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.ID), Config.Attribute.GetSqlTableNameByClassName <AccessoryInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.PublishID), MiicDBOperatorSetting.Equal, MiicDBRelationSetting.LeftJoin); MiicFriendRelation userRelation = new MiicFriendRelation(Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.CreaterID), Config.Attribute.GetSqlTableNameByClassName <Miic.Manage.User.SimplePersonUserView>(), Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Manage.User.SimplePersonUserView, string>(o => o.UserID), MiicDBOperatorSetting.Equal, MiicDBRelationSetting.LeftJoin); List <MiicFriendRelation> relations = new List <MiicFriendRelation>(); relations.Add(collectRelation); relations.Add(accRelation); relations.Add(userRelation); MiicRelationCollections relation = new MiicRelationCollections(Config.Attribute.GetSqlTableNameByClassName <PublishInfo>(), relations); MiicColumn microPartakePublishInfoAllColumns = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <PublishInfo>()); column.Add(microPartakePublishInfoAllColumns); MiicColumn microCollectInfoIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <CollectInfo>(), string.Empty, Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, string>(o => o.ID), "CommunityCollectInfoID"); column.Add(microCollectInfoIDColumn); MiicColumn collectTime = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <CollectInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, DateTime?>(o => o.CollectTime)); column.Add(collectTime); //收藏人员表 MiicColumn collectorIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <CollectInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, string>(o => o.CollectorID)); column.Add(collectorIDColumn); MiicColumn collectorNameColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <CollectInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <CollectInfo, string>(o => o.CollectorName)); column.Add(collectorNameColumn); MiicColumn microAccessoryIDColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <AccessoryInfo>(), string.Empty, Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.ID), "CommunityAccessoryInfoID"); column.Add(microAccessoryIDColumn); MiicColumn fileNameColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <AccessoryInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.FileName)); column.Add(fileNameColumn); MiicColumn filePathColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <AccessoryInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.FilePath)); column.Add(filePathColumn); MiicColumn uploadTime = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <AccessoryInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, DateTime?>(o => o.UploadTime)); column.Add(uploadTime); MiicColumn fileTypeColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <AccessoryInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <AccessoryInfo, string>(o => o.FileType)); column.Add(fileTypeColumn); MiicColumn orgNameColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <Miic.Manage.User.SimplePersonUserView>(), Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Manage.User.SimplePersonUserView, string>(o => o.OrgName)); column.Add(orgNameColumn); MiicColumn userUrlColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <Miic.Manage.User.SimplePersonUserView>(), Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Manage.User.SimplePersonUserView, string>(o => o.UserUrl)); column.Add(userUrlColumn); MiicColumn userTypeColumn = new MiicColumn(Config.Attribute.GetSqlTableNameByClassName <Miic.Manage.User.SimplePersonUserView>(), Config.Attribute.GetSqlColumnNameByPropertyName <Miic.Manage.User.SimplePersonUserView, string>(o => o.UserType)); column.Add(userTypeColumn); try { if (page == null) { result = dbService.GetInformations(column, relation, condition, out message); } else { result = dbService.GetInformationsPage(column, relation, condition, page, out message, MiicDBPageRowNumberSetting.DenseRank); } } 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); }
DataTable INoticeInfo <MessageInfo> .GetMyNoticeInfoList(MyNoticeView myNoticeView, MiicPage page) { Contract.Requires <ArgumentNullException>(myNoticeView != null, "参数myNoticeView:不能为空"); DataTable result = new DataTable(); string message = string.Empty; MiicConditionCollections conditions = myNoticeView.visitor(this); List <MiicOrderBy> order = new List <MiicOrderBy>(); order.Add(new MiicOrderBy() { Desc = true, PropertyName = Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, DateTime?>(o => o.PublishTime) }); conditions.order = order; MiicRelation relation = new MiicRelation(Config.Attribute.GetSqlTableNameByClassName <MessageInfo>(), Config.Attribute.GetSqlColumnNameByPropertyName <MessageInfo, string>(o => o.PublisherID), Config.Attribute.GetSqlTableNameByClassName <SimplePersonUserView>(), Config.Attribute.GetSqlColumnNameByPropertyName <SimplePersonUserView, string>(o => o.UserID), MiicDBOperatorSetting.Equal, MiicDBRelationSetting.InnerJoin); try { if (page != null) { result = dbService.GetInformationsPage(null, relation, conditions, page, out message); } else { result = dbService.GetInformations(null, relation, conditions, 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); }