Ejemplo n.º 1
0
        public static int CreateVote(VoteInfo vote)
        {
            int     num  = 0;
            VoteDao dao  = new VoteDao();
            long    num2 = dao.CreateVote(vote);

            if (num2 > 0L)
            {
                ReplyInfo reply = new TextReplyInfo {
                    Keys       = vote.Keys,
                    MatchType  = MatchType.Equal,
                    ReplyType  = ReplyType.Vote,
                    ActivityId = Convert.ToInt32(num2)
                };
                new ReplyDao().SaveReply(reply);
                num = 1;
                if (vote.VoteItems == null)
                {
                    return(num);
                }
                foreach (VoteItemInfo info2 in vote.VoteItems)
                {
                    info2.VoteId    = num2;
                    info2.ItemCount = 0;
                    num            += dao.CreateVoteItem(info2, null);
                }
            }
            return(num);
        }
Ejemplo n.º 2
0
        public static int CreateVote(VoteInfo vote)
        {
            int     num     = 0;
            VoteDao voteDao = new VoteDao();
            long    num2    = voteDao.CreateVote(vote);

            if (num2 > 0L)
            {
                num = 1;
                if (vote.VoteItems != null)
                {
                    foreach (VoteItemInfo current in vote.VoteItems)
                    {
                        current.VoteId    = num2;
                        current.ItemCount = 0;
                        num += voteDao.CreateVoteItem(current, null);
                    }
                }
            }
            return(num);
        }
Ejemplo n.º 3
0
        public static int CreateVote(VoteInfo vote)
        {
            int     num     = 0;
            VoteDao voteDao = new VoteDao();
            long    num1    = voteDao.CreateVote(vote);

            if (num1 > (long)0)
            {
                num = 1;
                if (vote.VoteItems != null)
                {
                    foreach (VoteItemInfo voteItem in vote.VoteItems)
                    {
                        voteItem.VoteId    = num1;
                        voteItem.ItemCount = 0;
                        num = num + voteDao.CreateVoteItem(voteItem, null);
                    }
                }
            }
            return(num);
        }
Ejemplo n.º 4
0
        public static int CreateVote(VoteInfo vote)
        {
            int     num  = 0;
            VoteDao dao  = new VoteDao();
            long    num2 = dao.CreateVote(vote);

            if (num2 > 0L)
            {
                num = 1;
                if (vote.VoteItems == null)
                {
                    return(num);
                }
                foreach (VoteItemInfo info in vote.VoteItems)
                {
                    info.VoteId    = num2;
                    info.ItemCount = 0;
                    num           += dao.CreateVoteItem(info, null);
                }
            }
            return(num);
        }
Ejemplo n.º 5
0
 public static long Create(VoteInfo vote)
 {
     return(_vote.CreateVote(vote));
 }