批量删除

<html>
<form name="form1" method="post" action="">
   <tr>
     <table>
       <tr>
         <td>
           <input type="checkbox" name="checkAll" value="" onClick="selectAll('checkAll','chkId');GetAllId(this,'temp','chkId');" title="全选">选择</td>
         </td>
         <td>
           员工编号
         </td>
       </tr>
       
       <logic:notEmpty name="rs">
         <logic:iterate name="rs" id="itm">
         <tr>
         <td>
          <input name="chkId" type="checkbox" id="chkId" value="<bean:write name="itm" property="id">" onClick="selectOne('checkAll');GetId(this,'temp');">
         </td>
         <td><bean:write name="itm" property="userid"/></td>
         </tr>
         </logic:iterate>
       </logic:notEmpty>
       
     </table>
       
     <table>
        <td>
        <input name="button1" type="button" value="添加" onclick="location.href='/pams/page/param/add.jsp">
        <input name="button2" type="button" value="删除" onclick="chicIt('del');">
        <input name="button3" type="button" value="修改" onclick="chicIt('modi');">
        </td>
     </table>
   </tr>
   
   <input type="hidden" name="temp" value="">
</form>
</html>

<script language="javascript">
  function chicIt(it){
   if(it=='del'){
       if((document.getElementById("temp").value=="")){
         window.alert("请选择记录进行删除");
       }else{
        if(window.confirm("/n是否确定删除?")){
         location.href="/pams/fundratAction.shtml?action=empdele &id="+document.getElementById("temp").value;
         }
        } 
    }else if (it=="modi"){
       if((document.getElementById("temp").value=="")){
        window.alert("请选择一条记录进行修改");
       }else{
        var oldvalue='提示:你仅更新一条记录';
        if(document.getElementById('temp').value.indexOf(",")>0){
        oldvalue='提示:正在更新记录';
        }
        location.href='/pams/page/param/utilUpdateParam.jsp?id='+document.getElementById('temp').value+'&oldValue='+oldValue+'<% if(request.getAttribute("urlParam")!=null) out.print((String)request.getAttribute("urlParam")); %>&action=/pams/FundrateAction.shtml?action=update';
       }                                                                                                                                                                                                                                                                                
   }
  }
</script>


=====================================DAO======================================
public ActionForward delete(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response) {

  String id = request.getParameter("id");

  try {
   if (!CFormat.isEmpty(id)) {

    String idArray[] = id.split(",");

    for (int i = 0; i < idArray.length; i++) {
     dao.delete(ParamRmbdepositrate.class, idArray[i]);
    }

    request.setAttribute("info", "删除参数成功!");
   }
  } catch (Exception ex) {
   request.setAttribute("info", "删除参数失败,请重试!");
   request.setAttribute("historyBack", "true");
  }
  request.setAttribute("result", "/pams/rmbckll.shtml?action=list");
  return mapping.findForward("result");

 }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值