Пример #1
0
 public List <Vote> FindVotes(VoteQueryModel model)
 {
     if (!CheckServiceStatus())
     {
         return(null);
     }
     return(_node.FindVotes(model));
 }
Пример #2
0
 public List <Voter> GetVoters(VoteQueryModel model)
 {
     if (!CheckServiceStatus())
     {
         return(null);
     }
     return(_node.GetVoters(model));
 }
        public async Task <List <Vote> > FindVotesAsync(VoteQueryModel model)
        {
            using var client = CreateClient();
            HttpResponseMessage response = await client.PostAsJsonAsync(
                "FindVotes", model, _cancel.Token).ConfigureAwait(false);

            response.EnsureSuccessStatusCode();
            if (response.IsSuccessStatusCode)
            {
                var result = await response.Content.ReadAsAsync <List <Vote> >();

                return(result);
            }
            else
            {
                throw new Exception("Web Api Failed.");
            }
        }
Пример #4
0
        /// <summary>
        /// 获取投票活动列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public BasePageList<VoteListModel> GetVoteList(VoteQueryModel query)
        {
            const string spName = "sp_common_pager";
            const string tableName = @"activity_vote_info as a ";
            const string fields = "innerid, title, enrollstarttime, enrollendtime, votestarttime, voteendtime,votemode,voteflow,prizedeac,awardstime,createdtime," +
                                  "(select count(1) from activity_vote_per where activityid=a.innerid) as numper," +
                                  "(select count(1) from activity_vote_log where activityid=a.innerid and invalid=0) as numvote";
            var oldField = string.IsNullOrWhiteSpace(query.Order) ? " a.createdtime asc " : query.Order;

            var sqlWhere = new StringBuilder(" 1=1 ");
            var model = new PagingModel(spName, tableName, fields, oldField, sqlWhere.ToString(), query.PageSize, query.PageIndex);
            var list = Helper.ExecutePaging<VoteListModel>(model, query.Echo);
            return list;
        }
 public List <Vote> FindVotes(VoteQueryModel model)
 {
     throw new NotImplementedException();
 }
 public List <Voter> GetVoters(VoteQueryModel model)
 {
     throw new NotImplementedException();
 }