Exemplo n.º 1
0
        private List<CY.CSTS.Core.Business.UserVote> HandleList2(IList<CY.CSTS.Core.Business.UserAnswer> list)
        {
            List<CY.CSTS.Core.Business.UserVote> uAList = new List<CY.CSTS.Core.Business.UserVote>();
            foreach (CY.CSTS.Core.Business.UserAnswer uA in list)
            {
                CY.CSTS.Core.Business.UserVote uV = new CY.CSTS.Core.Business.UserVote();
                uV.Id = uA.Id;
                uV.IP = uA.VoteRecord.IP;
                uV.UserName =uA.VoteRecord.UserName;//用户名
                uV.VoteAnswerName = uA.AnswerContent;
                CY.CSTS.Core.Business.VoteItem vI = CY.CSTS.Core.Business.VoteItem.Load(uA.VoteItemID);
                if (vI == null)
                    continue;
                uV.VoteItemName = vI.VoteItemContent;
                CY.CSTS.Core.Business.VoteRecord voteRecord = CY.CSTS.Core.Business.VoteRecord.Load(uA.VoteRecordID);
                if (voteRecord != null)
                {
                    uV.VoteTime = voteRecord.VoteTime;
                }
                uAList.Add(uV);
            }

            return uAList;
        }
Exemplo n.º 2
0
        private List<CY.CSTS.Core.Business.UserVote> HandleList(IList<CY.CSTS.Core.Business.VoteRecordDetail> list)
        {
            List<CY.CSTS.Core.Business.UserVote> uVList = new List<CY.CSTS.Core.Business.UserVote>();

            foreach (CY.CSTS.Core.Business.VoteRecordDetail vRD in list)
            {
                CY.CSTS.Core.Business.UserVote uV = new CY.CSTS.Core.Business.UserVote();
                uV.Id = vRD.Id;
                uV.IP = vRD.VoteRecord.IP;
                uV.UserName = vRD.VoteRecord.UserName;
                CY.CSTS.Core.Business.VoteAnswer vA = CY.CSTS.Core.Business.VoteAnswer.Load(vRD.VoteAnswerID);
                if (vA == null)
                    continue;
                uV.VoteAnswerName = vA.VoteAnswerContent;
                CY.CSTS.Core.Business.VoteItem vI = CY.CSTS.Core.Business.VoteItem.Load(vRD.VoteItemID);
                uV.VoteItemName = vI.VoteItemContent;
                uV.VoteTime = vRD.VoteTime;
                uVList.Add(uV);
            }

            return uVList;
        }