Exemplo n.º 1
0
        public static string MomentStateMap(MomentStateEnum state, DateTime?stopTime, bool isOverCount)
        {
            if (IsOverTime(stopTime))
            {
                return("活动已过期");
            }
            if (isOverCount)
            {
                return("活动人数已满");
            }
            switch (state)
            {
            case MomentStateEnum.正常发布中:
                return("活动进行中");

            case MomentStateEnum.审核中:
            case MomentStateEnum.被投诉审核中:
                return("活动审核中");

            case MomentStateEnum.审核被拒绝:
                return("活动审核不通过");

            case MomentStateEnum.被关小黑屋中:
            case MomentStateEnum.永久不支持上线:
                return("被关小黑屋中");

            default:
                return("活动已过期");
            }
        }
Exemplo n.º 2
0
        public List <MomentEntity> GetMomentListByState(MomentStateEnum state)
        {
            var sql = @"SELECT top (20) * FROM dbo.Moment Where State=@State  and IsDelete=0 and StopTime>GETDATE() order by CreateTime ";

            using var Db = GetDbConnection();
            return(Db.Query <MomentEntity>(sql, new { State = state }).AsList());
        }
Exemplo n.º 3
0
        public bool UpdateState(Guid momentId, MomentStateEnum momentState)
        {
            var sql = @"UPDATE dbo.Moment
                        SET State =@State,
                            UpdateTime = @UpdateTime
                        WHERE MomentId=@MomentId";

            using var Db = GetDbConnection();
            return(Db.Execute(sql, new
            {
                MomentId = momentId,
                State = momentState,
                UpdateTime = DateTime.Now
            }) > 0);
        }
Exemplo n.º 4
0
        public static string BtnTextMap(MomentStateEnum state, DateTime?stopTime, bool isApply, bool selfFlag, bool isOverCount)
        {
            if (isApply)
            {
                return("查看我的申请");
            }
            if (IsOverTime(stopTime) || isOverCount || selfFlag)
            {
                return("");
            }
            if (state == MomentStateEnum.正常发布中)
            {
                return("申请参与");
            }

            return("");
        }
Exemplo n.º 5
0
        public static string VerifyStateMap(MomentStateEnum state)
        {
            switch (state)
            {
            case MomentStateEnum.审核中:
            case MomentStateEnum.被投诉审核中:
                return("活动审核中");

            case MomentStateEnum.审核被拒绝:
                return("活动审核不通过");

            case MomentStateEnum.正常发布中:
            case MomentStateEnum.被关小黑屋中:
            case MomentStateEnum.永久不支持上线:
            default:
                return("已审核通过");
            }
        }
Exemplo n.º 6
0
        public static string TextColorMap(MomentStateEnum state, DateTime?stopTime, bool isOverCount)
        {
            if (IsOverTime(stopTime) || isOverCount)
            {
                return(CommonConst.Color_Black);
            }
            switch (state)
            {
            case MomentStateEnum.正常发布中:
                return(CommonConst.Color_Green);

            case MomentStateEnum.审核中:
            case MomentStateEnum.被投诉审核中:
            case MomentStateEnum.审核被拒绝:
                return(CommonConst.Color_Red);

            case MomentStateEnum.被关小黑屋中:
            case MomentStateEnum.永久不支持上线:
            default:
                return(CommonConst.Color_Black);
            }
        }
Exemplo n.º 7
0
        public PageResult <PublishMomentListDTO> GetSimulateUserPublishList(int page, int rows, long uId, MomentStateEnum state, DateTime startDateTime, DateTime endCreateTime)
        {
            var rtn        = new PageResult <PublishMomentListDTO>();
            var momentList = letterDal.GetMomentList(page, rows, uId, state, startDateTime, endCreateTime);

            if (momentList != null && momentList.Item1.NotEmpty())
            {
                rtn.Rows = momentList.Item1.Select(a => new PublishMomentListDTO()
                {
                    MomentId    = a.MomentId,
                    TextContent = a.TextContent.Trim(),
                    ImgContent  = a.ImgContent.GetImgPath(),
                    IsDelete    = a.IsDelete,
                    ReplyCount  = a.ReplyCount,
                    CreateTime  = a.CreateTime.GetDateDesc(),
                    CanEdit     = a.ReplyCount <= 0
                }).ToList();
                rtn.Total = momentList.Item2;
            }
            return(rtn);
        }