protected We7.CMS.Common.Vote GetData() { We7.CMS.Common.Vote currVote = VoteHelper.GetVoteByID(VoteID); if (currVote != null && !string.IsNullOrEmpty(currVote.ID)) { currVote.ListVoteEntrys = VoteHelper.GetVoteEntrysByID(currVote.ID); } return(currVote); }
protected override void OnDesigning() { if (string.IsNullOrEmpty(VoteID)) { vote = GetExampleData(); } else { vote = GetData(); } }
/// <summary> /// 得到例子数据 /// </summary> /// <returns></returns> private We7.CMS.Common.Vote GetExampleData() { We7.CMS.Common.Vote vote = null; vote = new Common.Vote(); vote.OptionType = 1; vote.Title = "投票测试"; vote.ListVoteEntrys = new List <VoteEntry>(); VoteEntry voteEntry = new VoteEntry(); voteEntry.EntryText = "选项1"; vote.ListVoteEntrys.Add(voteEntry); voteEntry = new VoteEntry(); voteEntry.EntryText = "选项2"; vote.ListVoteEntrys.Add(voteEntry); return(vote); }