customer_share_list.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import = "java.util.*"%>
  3. <%@ page import = "cn.js.fan.db.*"%>
  4. <%@ page import = "cn.js.fan.util.*"%>
  5. <%@ page import = "com.redmoon.oa.visual.module.sales.*"%>
  6. <%@ page import = "com.redmoon.oa.person.*"%>
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  10. <title>共享人员列表</title>
  11. <link href="../common.css" rel="stylesheet" type="text/css">
  12. <%@ include file="../inc/nocache.jsp"%>
  13. <script language="JavaScript" type="text/JavaScript">
  14. <!--
  15. function openWin(url,width,height)
  16. {
  17.   var newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=150,left=220,width="+width+",height="+height);
  18. }
  19. //-->
  20. </script>
  21. <style type="text/css">
  22. <!--
  23. .style2 {font-size: 14px}
  24. .STYLE3 {color: #FFFFFF}
  25. .STYLE4 {
  26. color: #000000;
  27. font-weight: bold;
  28. }
  29. .STYLE5 {color: #FF0000}
  30. .STYLE6 {color: #000000}
  31. -->
  32. </style>
  33. </head>
  34. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  35. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  36. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  37. <%
  38. String op = ParamUtil.get(request, "op");
  39. if (op.equals("add")) {
  40. CustomerShareMgr csm = new CustomerShareMgr();
  41. boolean re = false;
  42. try {
  43.   re = csm.create(request);
  44. }
  45. catch (ErrMsgException e) {
  46. out.print(StrUtil.Alert(e.getMessage()));
  47. }
  48. if (re)
  49. out.print(StrUtil.Alert("操作成功!"));
  50. }
  51. if (op.equals("del")) {
  52. CustomerShareMgr csm = new CustomerShareMgr();
  53. boolean re = false;
  54. try {
  55. re = csm.del(request);
  56. }
  57. catch (ErrMsgException e) {
  58. out.print(StrUtil.Alert(e.getMessage()));
  59. }
  60. if (re)
  61. out.print(StrUtil.Alert("操作成功!"));
  62. }
  63. CustomerShareDb csd = new CustomerShareDb();
  64. int id = ParamUtil.getInt(request,"id");
  65. %>
  66. <script language="javascript">
  67. function setPerson(deptCode, deptName, user, userRealName)
  68. {
  69. form1.sharePerson.value = user;
  70. form1.sharePersonRealName.value = userRealName;
  71. }
  72. </script>
  73. <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableframe" height="100%">
  74.   <tr>
  75.     <td class="right-title">&nbsp;共享人员列表</td>
  76.   </tr>
  77.   <form id=form1 name="form1" action="?op=add&id=<%=id%>" method=post onSubmit="return form1_onsubmit()">
  78.   <tr>
  79.     <td align="center"><span class="STYLE6">共享给</span>:
  80.       <input name="sharePerson" id="sharePerson" type=hidden>
  81.       <input name="sharePersonRealName" id="sharePersonRealName" style="width:50px">
  82.       <input name="customerId" id="customerId" type="hidden" value="<%=id%>" />
  83.       <a href="#" onClick="javascript:showModalDialog('../user_sel.jsp',window.self,'dialogWidth:480px;dialogHeight:320px;status:no;help:no;')">选择用户</a></span>
  84.       <input name="submit" type=submit class="button1" value="添  加"></td>
  85.   </tr>
  86.   <tr>
  87.     <td valign="top"><%
  88.   String sql = "select id from customer_share where customerId=" + id;
  89.   Iterator ir = csd.list(sql).iterator();
  90.   UserDb ud = new UserDb();
  91.   while (ir.hasNext()) {
  92.    csd = (CustomerShareDb)ir.next();%>
  93.       <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  94.         <tr>
  95.           <td width="59%"><%
  96. ud = ud.getUserDb(csd.getSharePerson());
  97. %>
  98.               <%=ud.getRealName()%> </td>
  99.           <td width="11%"><a href="#" onClick="if (confirm('您确定要删除<%=csd.getSharePerson()%>吗?')) window.location.href='?op=del&id=<%=id%>&delId=<%=csd.getId()%>'">删除</a></td>
  100.         </tr>
  101.       </table>
  102.     <%}%></td>
  103.   </tr>
  104.   </form>
  105. </table>
  106. </body>
  107. <script>
  108. function form1_onsubmit() {
  109. if (form1.sharePerson.value=="") {
  110. alert("请输入用户名");
  111. return false;
  112. }
  113. }
  114. </script>
  115. </html>