예제 #1
0
        /// <summary>
        /// 组装数据
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        private List <MessageRecodeEntity> GetMsgList(List <MessageRecodeEntity> list, MessageRecodeQuery mQuery)
        {
            if (list == null || list.Count == 0)
            {
                return(list);
            }
            AuthorInfoService service = new AuthorInfoService();
            AuthorInfoEntity  entity  = new AuthorInfoEntity();
            AuthorInfoQuery   query   = new AuthorInfoQuery();

            query.JournalID = mQuery.JournalID;
            var dict = service.AuthorInfoBusProvider.GetAuthorDict(query);


            //获取稿件作者数据字典
            ContributionInfoService cservice = new ContributionInfoService();
            ContributionInfoEntity  centity  = new ContributionInfoEntity();
            ContributionInfoQuery   cquery   = new ContributionInfoQuery();

            cquery.JournalID = mQuery.JournalID;
            cquery.CID       = (long)mQuery.CID;
            var cdict = cservice.GetContributionAuthorDict(cquery);

            centity = cservice.GetContributionInfo(cquery);

            foreach (var mode in list)
            {
                mode.SendUserName = dict.GetValue(mode.SendUser, mode.SendUser.ToString());
                entity            = service.GetAuthorInfo(mode.ReciveUser);
                if (entity != null)
                {
                    mode.ReciveUserName = dict.GetValue(mode.ReciveUser, mode.ReciveUser.ToString());
                }
                else
                {
                    mode.ReciveUserName = cdict.GetValue(mode.ReciveUser, mode.ReciveUser.ToString());
                }
            }
            return(list);
        }
예제 #2
0
        /// <summary>
        /// 组装数据
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        private List<MessageRecodeEntity> GetMsgList(List<MessageRecodeEntity> list, MessageRecodeQuery mQuery)
        {
            if (list == null || list.Count == 0)
                return list;
            AuthorInfoService service = new AuthorInfoService();
            AuthorInfoEntity entity = new AuthorInfoEntity();
            AuthorInfoQuery query = new AuthorInfoQuery();
            query.JournalID = mQuery.JournalID;
            var dict = service.AuthorInfoBusProvider.GetAuthorDict(query);

            //获取稿件作者数据字典
            ContributionInfoService cservice = new ContributionInfoService();
            ContributionInfoEntity centity = new ContributionInfoEntity();
            ContributionInfoQuery cquery = new ContributionInfoQuery();
            cquery.JournalID = mQuery.JournalID;
            cquery.CID = (long)mQuery.CID;
            var cdict = cservice.GetContributionAuthorDict(cquery);
            centity = cservice.GetContributionInfo(cquery);

            foreach (var mode in list)
            {
                mode.SendUserName = dict.GetValue(mode.SendUser, mode.SendUser.ToString());
                entity = service.GetAuthorInfo(mode.ReciveUser);
                if(entity!=null)
                    mode.ReciveUserName = dict.GetValue(mode.ReciveUser, mode.ReciveUser.ToString());
                else
                    mode.ReciveUserName = cdict.GetValue(mode.ReciveUser, mode.ReciveUser.ToString());

            }
            return list;
        }