Example #1
0
        public bool AddWordMsg(WordMsgDetail wordMsg)
        {
            var req = new AddWebForbidWordMessageRequest();

            req.IntWordType   = wordMsg.IntWordType;
            req.VchForbidWord = wordMsg.VchForbidWord;
            var res = BSClient.Send <AddWebForbidWordMessageResponse>(req);

            return(res.DoFlag);
        }
Example #2
0
        /// <summary>
        /// 根据Id查询单条信息
        /// </summary>
        /// <returns></returns>
        public WordMsgDetail QueryById(int id)
        {
            var result = new WordMsgDetail();
            var req    = new QueryWebForbidWordMessageByIdRequest();

            req.IntForbidID = id;

            var res = BSClient.Send <QueryWebForbidWordMessageByIdResponse>(req);

            if (res.DoFlag)
            {
                result = Mapper.Map <Web_Forbid_Word_MessageExt, WordMsgDetail>(res.ForbidWordDos);
            }
            return(result);
        }
Example #3
0
        public ActionResult Detail(int?id)
        {
            var viewModel = new WordMsgDetail();

            try
            {
                if (id > 0)
                {
                    viewModel = ForbidWordMsgClient.Instance.QueryById(id.Value);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(View(viewModel));
        }
Example #4
0
        public JsonResult Save(WordMsgDetail wordMsg)
        {
            var jsonResult = new BaseResponse()
            {
            };

            try
            {
                if (wordMsg.IntForbidID > 0)
                {
                    //修改
                    var result = ForbidWordMsgClient.Instance.UpdateWordMsg(wordMsg);
                    if (result)
                    {
                        jsonResult.DoFlag = true;
                    }
                    else
                    {
                        jsonResult.DoResult = "修改失败,请重试!";
                    }
                }
                else
                {
                    //新增
                    var result = ForbidWordMsgClient.Instance.AddWordMsg(wordMsg);
                    if (result)
                    {
                        jsonResult.DoFlag = true;
                    }
                    else
                    {
                        jsonResult.DoResult = "新增失败,请重试!";
                    }
                }
            }
            catch (Exception ex)
            {
                jsonResult.DoResult = "保存异常... ...";
            }
            return(Json(jsonResult));
        }