Exemplo n.º 1
0
        public static void VoteAnswerNew()
        {
            VoteAnswer item = new VoteAnswer();

            item.Id             = Guid.NewGuid();
            PSCDialog.DataShare = new VoteAnswerArgs(item, false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 是否投票回答已经存在
        /// </summary>
        /// <param name="voteAnswer"></param>
        #region bool IsVoteAnswerExist(VoteAnswer voteAnswer)
        protected bool IsVoteAnswerExist(VoteAnswer voteAnswer)
        {
            Criteria criteria = new Criteria(CriteriaType.Equals, "VoteID", voteAnswer.VoteID);

            if (!string.IsNullOrEmpty(voteAnswer.AccountID))
            {
                criteria.Add(CriteriaType.Equals, "AccountID", voteAnswer.AccountID);
            }
            else
            {
                criteria.Add(CriteriaType.Equals, "IP", voteAnswer.IP);
            }

            List <VoteAnswer> listAnswers = Assistant.List <VoteAnswer>(criteria, null);

            return(listAnswers != null && listAnswers.Count > 0);
        }
Exemplo n.º 3
0
        // POST: api/SubmitVote
        public void Post([FromBody] VoteAnswer value)
        {
            var context = GlobalHost.ConnectionManager.GetHubContext <MyHub>();

            context.Clients.All.ShowVote(value);
        }
Exemplo n.º 4
0
 public void ShowVote(VoteAnswer ans)
 {
     Clients.All.ShowVote(ans);
 }