public ActionResult PictureVoteItemApprove()
        {
            Campaign_PictureVoteItemApproveArgs args = RequestArgs <Campaign_PictureVoteItemApproveArgs>();

            if (args == null)
            {
                return(RespondResult(false, "参数无效。"));
            }

            NormalResult result = _campaignManager.PictureVote.PictureVoteItemApprove(this.DomainContext, args);

            #region 操作日志

            if (result.Success)
            {
                _operatedLogManager.Create(new OperatedLogEntity()
                {
                    Domain      = DomainContext.Domain.Id,
                    AppId       = DomainContext.AppId,
                    User        = MemberContext.User.Id,
                    IP          = Request.UserHostAddress,
                    Module      = EnumModule.Campaign,
                    Description = "审核通过最美投票活动中的项目"
                });
            }

            #endregion

            return(RespondResult(result.Success, result.Message));
        }
Exemple #2
0
        /// <summary>
        /// 修改审核状态 ,通过
        /// </summary>
        /// <param name="args"></param>
        public NormalResult PictureVoteItemApprove(DomainContext domainContext, Campaign_PictureVoteItemApproveArgs args)
        {
            //判断是否达到最大可参与人数
            if (PictureVoteIsFullParticipant(args.CampaignId))
            {
                return(new NormalResult("该活动已达最大允许参与人数,如需调整允许参与的人数,请编辑此活动基本信息。"));
            }

            List <CommandParameter> parameterList = new List <CommandParameter>();

            parameterList.Add(new CommandParameter("@id", args.ItemId));
            parameterList.Add(new CommandParameter("@approveStatus", EnumCampaignPictureVoteItemApproveStatus.Approved));

            _campaignManager.DataBase.ExecuteNonQuery("UPDATE [Campaign_PictureVoteItem] SET [ApproveStatus] = @approveStatus WHERE [Id] = @id",
                                                      parameterList);

            //奖励参与者积分
            if (args.MemberId.HasValue)
            {
                Campaign_PictureVoteEntity campaignPictureVote = GetPictureVote(args.CampaignId);
                if (campaignPictureVote.ApprovedPoint > 0)
                {
                    CampaignEntity campaign = _campaignManager.GetCampaign(args.CampaignId);

                    PointTrackArgs pointTrackArgs = new PointTrackArgs();
                    pointTrackArgs.DomainId = campaign.Domain;
                    pointTrackArgs.MemberId = args.MemberId.Value;
                    pointTrackArgs.Quantity = campaignPictureVote.ApprovedPoint;
                    pointTrackArgs.Type     = MemberPointTrackType.Campaign;
                    pointTrackArgs.TagName  = campaign.Name;
                    pointTrackArgs.TagId    = campaign.Id;

                    _campaignManager.MemberManager.PointTrack(pointTrackArgs);
                }
            }

            return(new NormalResult());
        }