示例#1
0
        public HttpResponseMessage GetFeedbackList(string FeedbackSearchDTO)
        {
            FeedbackSearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <FeedbackSearchDTO>(FeedbackSearchDTO);
            ResultDTO <List <FeedbackResultDTO> > actionresult = new ResultDTO <List <FeedbackResultDTO> >();

            try
            {
                actionresult.Object       = _ICommonServices.GetFeedbackList(dto);
                actionresult.SubmitResult = true;
                actionresult.rows         = dto.rows;
                actionresult.page         = dto.page;
                actionresult.Count        = dto.Count;
            }
            catch (Exception ex)
            {
                actionresult.SubmitResult = false;
                actionresult.Message      = ex.Message;
            }
            HttpResponseMessage result = new HttpResponseMessage
            {
                Content = new StringContent(JsonConvert.SerializeObject(actionresult),
                                            System.Text.Encoding.GetEncoding("UTF-8"),
                                            "application/json")
            };

            return(result);
        }
示例#2
0
        public void TestMethod1()
        {
            //查询反馈
            FeedbackSearchDTO dto = new FeedbackSearchDTO();

            dto.page = 1;
            dto.rows = 1;
            List <FeedbackResultDTO> list = _ICommonServices.GetFeedbackList(dto);
            //新增反馈
            FeedbackOperateDTO dto1 = new FeedbackOperateDTO();

            dto1.UserID          = 1;
            dto1.FeedbackSystem  = "基础数据";
            dto1.FeedbackModel   = "区域管理";
            dto1.FeedbackStaus   = 0;
            dto1.FeedbackDate    = DateTime.Now;
            dto1.FeedbackContent = "测试";
            int bl = _ICommonServices.AddFeedback(dto1);

            Assert.AreNotEqual(bl, -1);

            //查询反馈
            FeedbackSearchDTO dto2 = new FeedbackSearchDTO();

            dto2.page = 1;
            dto2.rows = 1;
            List <FeedbackResultDTO> list1 = _ICommonServices.GetFeedbackList(dto2);
            //修改状态
            FeedbackOperateDTO dto3 = new FeedbackOperateDTO();

            dto3.FeedbackStatID = (list1[0]).FeedbackStatID;
            dto3.FeedbackStaus  = 1;
            dto3.DealUser       = "******";
            dto3.DealDatetime   = DateTime.Now;
            bool bl1 = _ICommonServices.UpdateFeedback(dto3);

            Assert.IsTrue(bl1);
        }