标签:class search getc click color pos oid 优惠券 void
新增
<div class="panel panel-default">
<input type="button" class="btn btn-primary" onclick="addUser()" value="添加">
</div>
addDia = null;
//新增
function addStu(){
addDia =BootstrapDialog.show({
title: ‘添加信息‘,
message: $(‘<div></div>‘).load(‘<%=request.getContextPath()%>/stu/toAddStu.do‘), //跳新增页面
buttons: [{
label: ‘保存‘,
action: function(dialog){
$.ajax({
type:"post",
url:"<%=request.getContextPath()%>/stu/addStus.do",
data:$("#add-form").serialize(),
success:function(msg){
msgDia = BootstrapDialog.show({
message:"保存成功"
})
//searchStu()
location.reload();
setTimeout(function(){
msgDia.close();
addDia.close();
}, 2000)
}
})
}
}, {
label: ‘取消‘,
action: function(dialog) {
//更改弹框标题
// dialog.setTitle(‘Title 2‘);
dialog.close();
}
}]
});
}
controller
@RequestMapping("addCoupon")
@ResponseBody
public void addCoupon(Coupon cc){
ysqService.addCoupon(cc);
}
mapper
<!--,#{couDate},couDate 新增优惠券-->
<insert id="addCoupon" >
insert into coupon (couName,couPrice,man,jiange,couimg) values(#{couName},#{couPrice},#{man},#{jiange},#{couimg})
</insert>
标签:class search getc click color pos oid 优惠券 void
原文地址:https://www.cnblogs.com/yu72732/p/12621107.html