コード例 #1
0
        public HttpResponseMessage PostAccept([FromBody] AcceptModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, new { status = "error", errorMsg = "参数错误" }, Configuration.Formatters.JsonFormatter));
            }
            //先查询是否已采纳
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("@openId", model.OpenId);
            dic.Add("@MarkersOpenId", model.MarkersOpenId);
            dic.Add("@MarkersId", model.MarkersId.ToString());
            dic.Add("@type", model.Type.ToString());
            dic.Add("@image", "../../img/jifen.png");
            var count = MarkersDapper.Transaction("accept_C", dic);
            HttpResponseMessage result =
                Request.CreateResponse(HttpStatusCode.OK, new { status = "OK", data = count }, Configuration.Formatters.JsonFormatter);

            return(result);
        }