Exemple #1
0
        public void Delete(int siteId, int pollId)
        {
            if (pollId <= 0)
            {
                return;
            }

            _repository.Delete(pollId);

            FieldManager.Repository.DeleteByPollId(pollId);
            ItemManager.Repository.DeleteByPollId(pollId);
            LogManager.Repository.DeleteByPollId(pollId);

            PollManager.ClearCache(siteId);
        }
Exemple #2
0
        public int Insert(PollInfo pollInfo)
        {
            if (pollInfo.SiteId == 0)
            {
                return(0);
            }
            if (pollInfo.ChannelId == 0 && pollInfo.ContentId == 0 && string.IsNullOrEmpty(pollInfo.Title))
            {
                return(0);
            }

            if (pollInfo.ContentId == 0)
            {
                pollInfo.Taxis = GetMaxTaxis(pollInfo.SiteId) + 1;
            }

            pollInfo.Id = _repository.Insert(pollInfo);

            PollManager.ClearCache(pollInfo.SiteId);

            return(pollInfo.Id);
        }
Exemple #3
0
        private void SetTaxis(int siteId, int pollId, int taxis)
        {
            _repository.Update(Q.Set(Attr.Taxis, taxis).Where(Attr.Id, pollId));

            PollManager.ClearCache(siteId);
        }