AP_Job_Public_Action.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:3k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <!--#include file="../lib/strlib.asp" -->
  6. <!--#include file="../lib/UserCheck.asp" -->
  7. <%
  8. 'Copyright (c) 2006 Foosun Inc. Code by awen
  9. Response.Buffer = True
  10. Response.Expires = -1
  11. Response.ExpiresAbsolute = Now() - 1
  12. Response.Expires = 0
  13. Response.CacheControl = "no-cache"
  14. if not Session("FS_UserNumber")<>"" then response.Redirect("../lib/error.asp?ErrCodes=<li>你尚未登陆,或过期.</li>&ErrorUrl=../login.asp") : response.End()
  15. Dim Ap_Rs,Ap_Sql
  16. select case request.QueryString("Act")
  17. case "Del"
  18. Del
  19. case "Save"
  20. Save
  21. case else
  22. response.Redirect("job_applications.asp")
  23. end select
  24. Function and_where(sql)
  25. if instr(lcase(sql)," where ")>0 then 
  26. and_where = sql & " and "
  27. else
  28. and_where = sql & " where "
  29. end if
  30. End Function
  31. ''得到相关表的值。
  32. Function Get_OtherTable_Value(This_Fun_Sql)
  33. Dim This_Fun_Rs
  34. if instr(This_Fun_Sql," FS_ME_")>0 then 
  35. set This_Fun_Rs = User_Conn.execute(This_Fun_Sql)
  36. else
  37. set This_Fun_Rs = Conn.execute(This_Fun_Sql)
  38. end if
  39. if not This_Fun_Rs.eof then 
  40. Get_OtherTable_Value = This_Fun_Rs(0)
  41. else
  42. Get_OtherTable_Value = ""
  43. end if
  44. if Err.Number>0 then 
  45. Err.Clear
  46. response.Redirect("../lib/error.asp?ErrCodes=<li>Get_OtherTable_Value未能得到相关数据。错误描述:"&Err.Description&"</li>") : response.End()
  47. end if
  48. set This_Fun_Rs=nothing 
  49. End Function
  50.   
  51. Sub Del()
  52. Dim Str_Tmp
  53. if request.QueryString("PID")<>"" then 
  54. Conn.execute("Delete from FS_AP_Job_Public where PID = "&request.QueryString("PID"))
  55. else
  56. Str_Tmp = request.form("PID")
  57. if Str_Tmp="" then response.Redirect("../lib/error.asp?ErrCodes=<li>你必须至少选择一个进行删除。</li>")
  58. Str_Tmp = replace(Str_Tmp," ","")
  59. Conn.execute("Delete from FS_AP_Job_Public where PID in ("&Str_Tmp&")")
  60. end if
  61. response.Redirect("../lib/Success.asp?ErrorUrl="&server.URLEncode( "../job/AP_Job_Public_List.asp" )&"&ErrCodes=<li>恭喜,删除成功。</li>")
  62. End Sub
  63. ''================================================================
  64. Sub Save()
  65. Dim Str_Tmp,Arr_Tmp,PID
  66. Str_Tmp = "JobName,JobDescription,ResumeLang,WorkCity,PublicDate,EndDate,NeedNum"
  67. Arr_Tmp = split(Str_Tmp,",")
  68. PID = NoSqlHack(request.Form("PID"))
  69. if not isnumeric(PID) or PID = "" then PID = 0 
  70. Ap_Sql = "select UserNumber,"&Str_Tmp&"  from FS_AP_Job_Public  where UserNumber = '"&Session("FS_UserNumber")&"' and PID="&PID
  71. response.Write(Ap_Sql)
  72. Set Ap_Rs = CreateObject(G_FS_RS)
  73. Ap_Rs.Open Ap_Sql,Conn,3,3
  74. if PID > 0 then 
  75. ''修改
  76. for each Str_Tmp in Arr_Tmp
  77. Ap_Rs(Str_Tmp) = NoSqlHack(request.Form(Str_Tmp))
  78. next
  79. Ap_Rs.update
  80. Ap_Rs.close
  81. response.Redirect("../lib/Success.asp?ErrorUrl="&server.URLEncode( "../job/AP_Job_Public_AddUpdate.asp?Act=Edit&PID="&PID )&"&ErrCodes=<li>恭喜,修改成功。</li>")
  82. else
  83. ''新增 允许重复
  84. Ap_Rs.addnew
  85. Ap_Rs("UserNumber") = Session("FS_UserNumber")
  86. for each Str_Tmp in Arr_Tmp
  87. 'response.Write(Str_Tmp&":"&NoSqlHack(request.Form(Str_Tmp))&"<br>")
  88. Ap_Rs(Str_Tmp) = NoSqlHack(request.Form(Str_Tmp))
  89. next
  90. 'response.End()
  91. Ap_Rs.update
  92. Ap_Rs.close
  93. response.Redirect("../lib/Success.asp?ErrorUrl="&server.URLEncode( "../job/AP_Job_Public_AddUpdate.asp?Act=Add" ) &"&ErrCodes=<li>恭喜,新增成功。</li>")
  94. end if
  95. End Sub
  96. Set Ap_Rs=nothing
  97. Conn.close
  98. %>
  99. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->