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

数据库编程

开发平台:

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. dim p_s_id,p_s_ClassID,p_s_MyClassID,p_s_PubTitle,p_s_PubType,p_s_PubContent,p_s_Keyword,p_s_ValidTime,p_s_CompType,p_s_PubNumber,p_s_PubPrice,p_s_PubPack,p_s_Pubgui,p_s_PubPic_1,p_s_PubPic_2,p_s_PubPic_3,p_s_PubAddress,obj_save_rs
  9. dim obj_sys_rs,sys_islock,p_s_AreaID
  10. p_s_ClassID = Request.Form("ClassID")
  11. p_s_MyClassID = Request.Form("MyClassID")
  12. p_s_PubTitle = Request.Form("PubTitle")
  13. p_s_PubType = Request.Form("PubType")
  14. p_s_PubContent = Request.Form("PubContent")
  15. p_s_Keyword = Request.Form("keyword1")&","&Request.Form("keyword2")&","&Request.Form("keyword3")
  16. p_s_CompType = Request.Form("CompType")
  17. p_s_PubNumber = Request.Form("PubNumber")
  18. p_s_PubPrice = Request.Form("PubPrice")
  19. p_s_PubPack = Request.Form("PubPack")
  20. p_s_Pubgui = Request.Form("Pubgui")
  21. p_s_PubPic_1 = Request.Form("pic_1")
  22. p_s_PubPic_2 = Request.Form("pic_2")
  23. p_s_PubPic_3 = Request.Form("pic_3")
  24. p_s_ValidTime = Request.Form("ValidTime") 
  25. p_s_PubAddress = Request.Form("PubAddress")
  26. p_s_AreaID = Request.Form("AreaID")
  27. p_s_id =  NoSqlHack(Request.Form("id"))
  28. set obj_sys_rs = Conn.execute("select top 1 islock,m_islock from FS_SD_Config")
  29. if obj_sys_rs.eof then
  30. strShowErr = "<li>找不到系统配置,请与管理员联系</li>"
  31. Response.Redirect(""& s_savepath &"/lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  32. Response.end
  33. end if
  34. if trim(p_s_PubNumber)<>"" or trim(p_s_PubNumber)<>empty then
  35. if Not isnumeric(p_s_PubNumber) then
  36. strShowErr = "<li>产品数量应该为数字</li>"
  37. Response.Redirect(""& s_savepath &"/lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  38. Response.end
  39. end if
  40. end if
  41. if Not isnumeric(p_s_PubPrice)  then
  42. strShowErr = "<li>产品价格应该为数字</li>"
  43. Response.Redirect(""& s_savepath &"/lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  44. Response.end
  45. end if
  46. if len(p_s_PubContent)>5000 then
  47. strShowErr = "<li>信息描述不能超过5000个字符</li>"
  48. Response.Redirect(""& s_savepath &"/lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  49. Response.end
  50. end if
  51. if not isnumeric(p_s_ValidTime) then
  52. strShowErr = "<li>有效期不为数字</li>"
  53. Response.Redirect(""& s_savepath &"/lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  54. Response.end
  55. end if
  56. if int(p_s_ValidTime)<1 or int(p_s_ValidTime)>360 then
  57. strShowErr = "<li>有效期为1~360</li>"
  58. Response.Redirect(""& s_savepath &"/lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  59. Response.end
  60. end if
  61. set obj_save_rs = Server.CreateObject(G_FS_RS)
  62. if Request.Form("Action")="add" or Request.Form("Action")="Copy" then
  63. obj_save_rs.open "select * from FS_SD_News where 1=0",Conn,1,3
  64. obj_save_rs.addnew
  65. obj_save_rs("Addtime")=now
  66. elseif  Request.Form("Action")="edit" then
  67. obj_save_rs.open "select * from FS_SD_News where id="&p_s_id,Conn,1,3
  68. end if
  69. obj_save_rs("EditTime")=now
  70. obj_save_rs("ClassID")=p_s_ClassID
  71. if trim(p_s_MyClassID)<>"" then:obj_save_rs("MyClassID")=p_s_MyClassID:else:obj_save_rs("MyClassID")=0:end if
  72. obj_save_rs("UserNumber")=session("FS_UserNumber")
  73. obj_save_rs("PubTitle")=p_s_PubTitle
  74. if p_s_PubType = "0" then
  75. obj_save_rs("PubType")=0
  76. elseif  p_s_PubType ="1" then
  77. obj_save_rs("PubType")=1
  78. elseif  p_s_PubType ="2" then
  79. obj_save_rs("PubType")=2
  80. elseif  p_s_PubType ="3" then
  81. obj_save_rs("PubType")=3
  82. else
  83. obj_save_rs("PubType")=4
  84. end if
  85. obj_save_rs("PubContent")=p_s_PubContent
  86. obj_save_rs("Keyword")=p_s_Keyword
  87. if p_s_CompType="0" then
  88. obj_save_rs("CompType")=0
  89. elseif  p_s_CompType="1" then
  90. obj_save_rs("CompType")=1
  91. else
  92. obj_save_rs("CompType")=2
  93. end if
  94. if p_s_PubNumber<>"" then:obj_save_rs("PubNumber")=p_s_PubNumber:else:obj_save_rs("PubNumber")=0:end if
  95. obj_save_rs("PubPrice")=p_s_PubPrice
  96. obj_save_rs("PubPack")=p_s_PubPack
  97. obj_save_rs("Pubgui")=p_s_Pubgui
  98. if p_s_PubPic_1<>"" then  obj_save_rs("PubPic_1")=p_s_PubPic_1
  99. if p_s_PubPic_2<>"" then  obj_save_rs("PubPic_2")=p_s_PubPic_2
  100. if p_s_PubPic_3<>"" then  obj_save_rs("PubPic_3")=p_s_PubPic_3
  101. obj_save_rs("ValidTime")=p_s_ValidTime
  102. if Request.Form("Action")="edit" then
  103. if obj_sys_rs("m_islock")=1 then
  104. obj_save_rs("isPass")=0
  105. end if
  106. elseif Request.Form("Action")="add" then
  107. if obj_sys_rs("islock")=1 then
  108. obj_save_rs("isPass")=0
  109. else
  110. obj_save_rs("isPass")=1
  111. end if
  112. end if
  113. obj_save_rs("AdminUserName")="0"
  114. obj_save_rs("s_Templet")=replace(G_VIRTUAL_ROOT_DIR&"/"&G_TEMPLETS_DIR&"/Supply/Page.htm","//","/")
  115. obj_save_rs("FileExtName")="html"
  116. obj_save_rs("HideTF")=0
  117. obj_save_rs("OrderID")=0
  118. obj_save_rs("PubAddress")=p_s_PubAddress
  119. obj_save_rs("AreaID")=p_s_AreaID
  120. obj_save_rs.update
  121. obj_save_rs.close:set obj_save_rs = nothing
  122. obj_sys_rs.close:set obj_sys_rs = nothing
  123. if Request.Form("Action")="add" then
  124. strShowErr = "<li>添加供求信息成功</li><br><li><a href="&s_savepath&"/supply/PublicSupply.asp>继续添加</a>&nbsp;&nbsp;<a href="&s_savepath&"/supply/PublicManage.asp>返回</a></li>"
  125. elseif Request.Form("Action")="edit" then
  126. strShowErr = "<li>修改供求信息成功</li><br><li><a href="&s_savepath&"/supply/PublicSupplyEdit.asp?Id="& p_s_id &">继续修改</a>&nbsp;&nbsp;<a href="&s_savepath&"/supply/PublicManage.asp>返回</a></li>"
  127. else
  128. strShowErr = "<li>复制信息成功</li><br><li>&nbsp;&nbsp;<a href="&s_savepath&"/supply/PublicManage.asp>返回</a></li>"
  129. end if
  130. Response.Redirect(""& s_savepath &"/lib/success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl="& s_savepath &"/Supply/PublicManage.asp")
  131. Response.end
  132. %>
  133. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->