Ejemplo n.º 1
0
        public Result RemoveWork([FromBody] EditWorkStatusReq req)
        {
            req.Status = (int)WorkStatusTypes.REMOVE;

            var result =
                SqlHelper.ExecuteNonQuery(SqlHelper.GetConnString(), CommandType.StoredProcedure, StoreProcedureConst
                                          .EditWorkStatus,
                                          EntitySqlHelper.GetParameters(req));

            if (result > 0)
            {
                //p:发送被删除通知

                return(EditStatusByRelation(new AccusationEditStatusByRelationParam()
                {
                    RelationId = req.Id,
                    Status = 2,
                    TargetType = AccusationTargetTypes.Work
                }));
            }
            else
            {
                return(new Failure(ResultMsgConst.OperationFailure));
            }
        }
Ejemplo n.º 2
0
        public Result WorkAccept([FromBody] AcceptReq req)
        {
            if (req == null)
            {
                return(new Failure("para is null"));
            }

            var msg = req.ValidInfo();

            if (msg != string.Empty)
            {
                return(new Failure(msg));
            }

            var result = SqlHelper.ExecuteNonQuery(SqlHelper.GetConnString(), CommandType.StoredProcedure,
                                                   "accusation_edit_item_status",
                                                   new SqlParameter("@id", req.Id),
                                                   new SqlParameter("@status", 2),
                                                   new SqlParameter("@userId", req.UserId));

            if (result > 0)
            {
                //p:发送举报成功通知

                var param = new EditWorkStatusReq()
                {
                    Id     = req.RelationId,
                    Status = (int)WorkStatusTypes.REMOVE,
                    UserId = req.RelationUserId
                };

                result =
                    SqlHelper.ExecuteNonQuery(SqlHelper.GetConnString(), CommandType.StoredProcedure, StoreProcedureConst
                                              .EditWorkStatus,
                                              EntitySqlHelper.GetParameters(param));

                if (result > 0)
                {
                    //p:发送被删除通知

                    return(new Success(ResultMsgConst.OperationSuccess));
                }
                else
                {
                    return(new Failure(ResultMsgConst.OperationFailure));
                }
            }
            else
            {
                return(new Failure(ResultMsgConst.OperationFailure));
            }
        }
Ejemplo n.º 3
0
        public Result CommentAccept([FromBody] AcceptReq req)
        {
            if (req == null)
            {
                return(new Failure("para is null"));
            }

            var msg = req.ValidInfo();

            if (msg != string.Empty)
            {
                return(new Failure(msg));
            }

            var result = SqlHelper.ExecuteNonQuery(SqlHelper.GetConnString(), CommandType.StoredProcedure,
                                                   "accusation_edit_item_status",
                                                   new SqlParameter("@id", req.Id),
                                                   new SqlParameter("@status", 2),
                                                   new SqlParameter("@userId", req.UserId));

            if (result > 0)
            {
                var param = new EditStatusReq()
                {
                    Id     = req.RelationId,
                    Status = (int)CommentStatusTypes.UNUSEFUL
                };

                //p:发送举报成功通知

                var executeNonQuery = SqlHelper.ExecuteNonQuery(SqlHelper.GetConnString(), CommandType.StoredProcedure,
                                                                StoreProcedureConst.EditCommentStatus,
                                                                EntitySqlHelper.GetParameters(param));

                if (executeNonQuery > 0)
                {
                    //发送通知
                    //var msg = $"尊敬的用户,您的评论xxx,由于存在...,已被删除.";
                    return(new Success(ResultMsgConst.OperationSuccess));
                }
                else
                {
                    return(new Failure(ResultMsgConst.OperationFailure));
                }
            }
            else
            {
                return(new Failure(ResultMsgConst.OperationFailure));
            }
        }
Ejemplo n.º 4
0
        public Result EditStatusByRelation(AccusationEditStatusByRelationParam param)
        {
            var result = SqlHelper.ExecuteNonQuery(SqlHelper.GetConnString(), CommandType.StoredProcedure,
                                                   "accusation_edit_item_status_by_relation",
                                                   EntitySqlHelper.GetParameters(param));

            if (result > 0)
            {
                return(new Success(ResultMsgConst.OperationSuccess));
            }
            else
            {
                return(new Failure(ResultMsgConst.OperationFailure));
            }
        }
Ejemplo n.º 5
0
        public Result RemoveComment([FromBody] EditStatusReq req)
        {
            req.Status = (int)CommentStatusTypes.UNUSEFUL;

            var executeNonQuery = SqlHelper.ExecuteNonQuery(SqlHelper.GetConnString(), CommandType.StoredProcedure,
                                                            StoreProcedureConst.EditCommentStatus,
                                                            EntitySqlHelper.GetParameters(req));

            if (executeNonQuery > 0)
            {
                //发送通知
                //var msg = $"尊敬的用户,您的评论xxx,由于存在...,已被删除.";
                return(EditStatusByRelation(new AccusationEditStatusByRelationParam()
                {
                    RelationId = req.Id,
                    Status = 2,
                    TargetType = AccusationTargetTypes.Comment
                }));
            }
            else
            {
                return(new Failure(ResultMsgConst.OperationFailure));
            }
        }