Example #1
0
        public ActionResult Delete(string IDs, string Type, string Status, string PKIDs)
        {
            IEnumerable <int> ids = JsonConvert.DeserializeObject <IEnumerable <int> >(IDs);

            if (ids != null && ids.Count() > 0)
            {
                bool result = manager.DeleteBatch(ids);
                if (result)
                {
                    WriteOperatorLog(ids, "删除评论");
                    foreach (int id in ids)
                    {
                        MQMessageClient.DeleteMessageQueue(2, id.ToString());
                    }
                    if (!string.IsNullOrEmpty(Type) && Convert.ToInt32(Type) == 10 && Status == "已通过")
                    {
                        IEnumerable <int> pkids = JsonConvert.DeserializeObject <IEnumerable <int> >(PKIDs);
                        foreach (var pkid in pkids)
                        {
                            //晒图评论数+1
                            manager.UpdateShImgCommentCount(pkid, "-1");
                        }
                    }
                }
                return(Json(result));
            }
            else
            {
                return(Json(false));
            }
        }
Example #2
0
        public ActionResult Pass(string IDs, string UserID, string Type, string PKIDs)
        {
            IEnumerable <int> ids = JsonConvert.DeserializeObject <IEnumerable <int> >(IDs);

            if (ids != null && ids.Count() > 0)
            {
                bool result = manager.PassBatch(ids);
                if (result)
                {
                    //InsertMyCenterNewsAsync(ids);
                    WriteOperatorLog(ids, "评论通过");
                    foreach (int id in ids)
                    {
                        MQMessageClient.InsertMessageQueue(2, id.ToString(), UserID);
                    }
                    if (!string.IsNullOrEmpty(Type) && Convert.ToInt32(Type) == 10)
                    {
                        IEnumerable <int> pkids = JsonConvert.DeserializeObject <IEnumerable <int> >(PKIDs);
                        foreach (var pkid in pkids)
                        {
                            //晒图评论数+1
                            manager.UpdateShImgCommentCount(pkid, "+1");
                        }
                    }
                }
                return(Json(result));
            }
            else
            {
                return(Json(false));
            }
        }