| | |
| | | return JSON.stringify(model); |
| | | } |
| | | |
| | | function InsertImg() { |
| | | var data = getImg(); |
| | | |
| | | ajax("Img/Insert", "POST", data, null, null, function (rs) { |
| | | console.log(rs); |
| | | alert(rs); |
| | | }); |
| | | } |
| | | |
| | | function UpdateImgById() { |
| | | var data = getImg(); |
| | | |
| | | ajax("Img/UpdateById", "POST", data, null, null, function (rs) { |
| | | console.log(rs); |
| | | alert(rs); |
| | | }); |
| | | } |
| | | |
| | | function getImg() { |
| | | var model = { |
| | | id: $("#iid").val(), |
| | | name: $("#iname").val(), |
| | | path: $("#ipath").val(), |
| | | json: $("#ijson").val() |
| | | }; |
| | | |
| | | return JSON.stringify(model); |
| | | } |
| | | |
| | | function ajax(url, type, data, dataType, contentType, fn) { |
| | | $.ajax({ |
| | | url: url, |
| | |
| | | json: <textarea id="gjson" style="width: 1024px;height: 70px;">{ "type": "Feature", "properties": { "ID": "12", "NAME": "Area8", "REMARK": "" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 120.24179180542139, 32.005615085853492, 13.770 ], [ 120.24175240823769, 32.005610442630996, 13.770 ], [ 120.24173428512847, 32.005722106674966, 13.770 ], [ 120.24177368235908, 32.005726749902777, 13.770 ], [ 120.24179180542139, 32.005615085853492, 13.770 ] ] ] } }</textarea> <br /> |
| | | <input type="button" value="InsertGrid" onclick="InsertGrid();" /> |
| | | <input type="button" value="UpdateGridById" onclick="UpdateGridById();" /><br /> <br /> |
| | | |
| | | |
| | | 图片:<a href="http://localhost/JiangSu/Img/SelectByPage?pageSize=10&pageIndex=1&name=">SelectByPage?pageSize=10&pageIndex=1&name=</a> <span style="width: 50px;"> </span> |
| | | <a href="http://localhost/JiangSu/Img/SelectById?id=1">SelectById?id=1</a> <span style="width: 50px;"> </span> |
| | | <a href="http://localhost/JiangSu/Img/DeleteByIds?ids=3&ids=0">DeleteByIds?ids=3&ids=0</a> <br /> |
| | | |
| | | id: <input id="iid" value="1" /> <br /> |
| | | name: <input id="iname" value="1.jpg"/> <br /> |
| | | path: <input id="ipath" value="Images\1.jpg"/> <br /> |
| | | json: <input id="ijson" value="{}"/> <br /> |
| | | <input type="button" value="InsertImg" onclick="InsertImg();" /> |
| | | <input type="button" value="UpdateImgById" onclick="UpdateImgById();" /><br /> <br /> |
| | | </form> |
| | | </body> |
| | | </html> |