<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>PUT</title>
<script src="~/Scripts/jquery-3.4.1.js"></script>
</head>
<body>
<div>
<input id="Hidden1" type="hidden" value="@ViewBag.id" />
<table>
<tr>
<td>项目名称</td>
<td><input id="Text1" type="text" /></td>
</tr>
<tr>
<td>目标融资</td>
<td><input id="Text2" type="text" /></td>
</tr>
<tr>
<td>公司名称</td>
<td><input id="Text3" type="text" /></td>
</tr>
<tr>
<td>项目状态</td>
<td>
<input id="Radio1" type="radio" name="s" value="true" />开启
<input id="Radio" type="radio" name="s" value="false" />关闭
</td>
</tr>
</table>
<input id="Button1" type="button" value="返回" οnclick="οnclick="location.href='http://localhost:53971/Info/Index'"/>
<input id="Button1" type="button" value="提交" οnclick="onc()" />
</div>
</body>
</html>
<script>
$(function () {
Show();
});
function Show() {
$.ajax({
url: "http://localhost:53607/api/Info/UptUserInfo?Id=" + $("#Hidden1").val(),
type: "get",
dataType: "json",
success: function (d) {
$("#Text1").val(d.Name);
$("#Text2").val(d.MBRZ);
$("#Text3").val(d.GSName);
$('input[name="s"][value="'+ d.ZT +'"]').prop("checked", "true");
}
})
}
function onc() {
var ss = {};
ss.Name = $("#Text1").val();
ss.MBRZ = $("#Text2").val();
ss.GSName = $("#Text3").val();
ss.ZT = $("input[name='s']:checked").val();
ss.Id = $("#Hidden1").val();
$.ajax({
url: "http://localhost:53607/api/Info/UptDate",
type: "post",
data: ss,
success: function (d) {
if (d > 0) {
alert('修改成功');
}
else {
alert('修改失败');
}
}
})
}
</script>