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

数据库编程

开发平台:

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="../../FS_Inc/Func_page.asp" -->
  6. <!--#include file="../lib/strlib.asp" -->
  7. <!--#include file="../lib/UserCheck.asp" -->
  8. <%'Copyright (c) 2006 Foosun Inc. Code by Einstein.liu
  9. Dim sid,action,secondRs,sqlstatement,i
  10. Dim floorArray(2), HouseStyleArray(3)
  11. DIm s_SID,s_Class,s_UserNumber,s_Label,s_UseFor,s_FloorType,s_BelongType,s_HouseStyle,s_Structure,s_Area,s_BuildDate,s_Price,s_CityArea,s_Address,s_Floor,s_Position,s_Decoration,s_LinkMan,s_Contact,s_equip,s_Remark,s_PubDate,s_Audited,s_PicNumber
  12. action=request.QueryString("action")
  13. sid=NoSqlHack(request("id"))
  14. response.Charset="GB2312"
  15. if action="delete" then
  16. Conn.execute("Delete from FS_HS_Second where sid in ("&sid&")")
  17. Response.Write("ok")
  18. response.End()
  19. elseif action="add" then'------------------------------------------------------------------------------------------
  20. Set secondRs=Server.CreateObject(G_FS_RS)
  21. sqlstatement="select SID,Class,UserNumber,Label,UseFor,FloorType,BelongType,HouseStyle,Structure,Area,BuildDate,Price,CityArea,Address,Floor,Position,Decoration,LinkMan,Contact,equip,Remark,PubDate,Audited,PicNumber from FS_HS_Second"
  22. s_Class=trim(request.Form("sel_class"))
  23. s_UserNumber=session("FS_UserNumber")
  24. s_Label=trim(request.Form("txt_Label"))
  25. s_UseFor=trim(request.Form("sel_usefor"))
  26. s_FloorType=trim(request.Form("sel_FloorType"))
  27. s_BelongType=trim(request.Form("sel_BelongType"))
  28. HouseStyleArray(0)="1"
  29. HouseStyleArray(1)="1"
  30. HouseStyleArray(2)="1"
  31. if trim(request.Form("txt_HouseStyle_1"))<>"" then HouseStyleArray(0)=trim(request.Form("txt_HouseStyle_1"))
  32. if trim(request.Form("txt_HouseStyle_2"))<>"" then HouseStyleArray(1)=trim(request.Form("txt_HouseStyle_2"))
  33. if trim(request.Form("txt_HouseStyle_3"))<>"" then HouseStyleArray(2)=trim(request.Form("txt_HouseStyle_3"))
  34. s_HouseStyle=HouseStyleArray(0)&","&HouseStyleArray(1)&","&HouseStyleArray(2)
  35. s_Structure=trim(request.Form("sel_Structure"))
  36. s_Area=trim(request.Form("txt_Area"))
  37. s_BuildDate=trim(request.Form("txt_BuildDate"))
  38. s_Price=trim(request.Form("txt_price"))
  39. s_CityArea=trim(request.Form("txt_cityarea"))
  40. s_Address=trim(request.Form("txt_Address"))
  41. floorArray(0)="0"
  42. floorArray(1)="0"
  43. if trim(request.Form("txt_Floor_1"))<>"" then  floorArray(0)=trim(request.Form("txt_Floor_1"))
  44. if trim(request.Form("txt_Floor_2"))<>"" then  floorArray(1)=trim(request.Form("txt_Floor_2"))
  45. s_Floor=floorArray(0)&","&floorArray(1)
  46. s_Position=trim(request.Form("txt_Position"))
  47. s_Decoration=request.Form("sel_Decoration")
  48. s_LinkMan=request.Form("txt_LinkMan")
  49. s_Contact=request.Form("txt_Contact")
  50. s_equip=request.Form("chk_equip")
  51. s_Remark=request.Form("txt_Remark")
  52. s_PubDate=DateValue(Now)
  53. s_Audited=0
  54. s_PicNumber=request.Form("PicNum")
  55. '■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  56. secondRs.open sqlstatement,Conn,1,3
  57. secondRs.addnew
  58. secondRs("Class")=s_Class
  59. secondRs("UserNumber")=s_UserNumber
  60. secondRs("label")=s_label
  61. secondRs("UseFor")=s_UseFor
  62. secondRs("FloorType")=s_FloorType
  63. secondRs("BelongType")=s_BelongType
  64. secondRs("HouseStyle")=s_HouseStyle
  65. secondRs("Structure")=s_Structure
  66. secondRs("Area")=s_Area
  67. if s_BuildDate="" then s_BuildDate=0
  68. secondRs("BuildDate")=s_BuildDate
  69. if s_price="" then s_price=0
  70. secondRs("Price")=s_Price
  71. secondRs("CityArea")=s_CityArea
  72. secondRs("Address")=s_Address
  73. secondRs("Floor")=s_Floor
  74. secondRs("Position")=s_Position
  75. secondRs("LinkMan")=s_LinkMan
  76. secondRs("Contact")=s_Contact
  77. secondRs("equip")=s_equip
  78. secondRs("Decoration")=s_Decoration
  79. secondRs("Remark")=s_Remark
  80. secondRs("PubDate")=s_PubDate
  81. secondRs("Audited")=s_Audited
  82. s_picNumber=trim(request.Form("txt_PicNum"))
  83. if s_picNumber="" then s_picNumber=0
  84. secondRs("picNumber")=s_picNumber
  85. secondRs.update
  86. if Cint(s_picNumber)>0 then
  87. for i=0 to Cint(s_picNumber)
  88. if trim(request.Form("txt_PicNum_"&(i+1)))<>"" then
  89. Conn.execute("Insert into FS_HS_Picture (ID,HS_Type,PIC) values("&secondRs("sID")&",3,'"&request.Form("txt_PicNum_"&(i+1))&"')")
  90. End if
  91. next
  92. End if
  93. secondRs.close
  94. elseif action="edit" then
  95. Set secondRs=Server.CreateObject(G_FS_RS)
  96. sqlstatement="select SID,Class,UserNumber,Label,UseFor,FloorType,BelongType,HouseStyle,Structure,Area,BuildDate,Price,CityArea,Address,Floor,Position,Decoration,LinkMan,Contact,equip,Remark,PubDate,Audited,PicNumber from FS_HS_Second where sid="&sid
  97. s_Class=trim(request.Form("sel_class"))
  98. s_UserNumber=session("FS_UserNumber")
  99. s_Label=trim(request.Form("txt_Label"))
  100. s_UseFor=trim(request.Form("sel_usefor"))
  101. s_FloorType=trim(request.Form("sel_FloorType"))
  102. s_BelongType=trim(request.Form("sel_BelongType"))
  103. HouseStyleArray(0)="1"
  104. HouseStyleArray(1)="1"
  105. HouseStyleArray(2)="1"
  106. if trim(request.Form("txt_HouseStyle_1"))<>"" then HouseStyleArray(0)=trim(request.Form("txt_HouseStyle_1"))
  107. if trim(request.Form("txt_HouseStyle_2"))<>"" then HouseStyleArray(1)=trim(request.Form("txt_HouseStyle_2"))
  108. if trim(request.Form("txt_HouseStyle_3"))<>"" then HouseStyleArray(2)=trim(request.Form("txt_HouseStyle_3"))
  109. s_HouseStyle=HouseStyleArray(0)&","&HouseStyleArray(1)&","&HouseStyleArray(2)
  110. s_Structure=trim(request.Form("sel_Structure"))
  111. s_Area=trim(request.Form("txt_Area"))
  112. s_BuildDate=trim(request.Form("txt_BuildDate"))
  113. s_Price=trim(request.Form("txt_price"))
  114. s_CityArea=trim(request.Form("txt_cityarea"))
  115. s_Address=trim(request.Form("txt_Address"))
  116. floorArray(0)="0"
  117. floorArray(1)="0"
  118. if trim(request.Form("txt_Floor_1"))<>"" then  floorArray(0)=trim(request.Form("txt_Floor_1"))
  119. if trim(request.Form("txt_Floor_2"))<>"" then  floorArray(1)=trim(request.Form("txt_Floor_2"))
  120. s_Floor=floorArray(0)&","&floorArray(1)
  121. s_Position=trim(request.Form("txt_Position"))
  122. s_Decoration=request.Form("sel_Decoration")
  123. s_LinkMan=request.Form("txt_LinkMan")
  124. s_Contact=request.Form("txt_Contact")
  125. s_equip=request.Form("chk_equip")
  126. s_Remark=request.Form("txt_Remark")
  127. s_PubDate=DateValue(Now)
  128. s_Audited=0
  129. s_PicNumber=request.Form("PicNum")
  130. '■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  131. secondRs.open sqlstatement,Conn,1,3
  132. secondRs("Class")=s_Class
  133. secondRs("UserNumber")=s_UserNumber
  134. secondRs("label")=s_label
  135. secondRs("UseFor")=s_UseFor
  136. secondRs("FloorType")=s_FloorType
  137. secondRs("BelongType")=s_BelongType
  138. secondRs("HouseStyle")=s_HouseStyle
  139. secondRs("Structure")=s_Structure
  140. secondRs("Area")=s_Area
  141. if s_BuildDate="" then s_BuildDate=0
  142. secondRs("BuildDate")=s_BuildDate
  143. if s_price="" then s_price=0
  144. secondRs("Price")=s_Price
  145. secondRs("CityArea")=s_CityArea
  146. secondRs("Address")=s_Address
  147. secondRs("Floor")=s_Floor
  148. secondRs("Position")=s_Position
  149. secondRs("LinkMan")=s_LinkMan
  150. secondRs("Contact")=s_Contact
  151. secondRs("equip")=s_equip
  152. secondRs("Decoration")=s_Decoration
  153. secondRs("Remark")=s_Remark
  154. secondRs("PubDate")=s_PubDate
  155. secondRs("Audited")=s_Audited
  156. s_picNumber=trim(request.Form("txt_PicNum"))
  157. if s_picNumber="" then s_picNumber=0
  158. secondRs("picNumber")=s_picNumber
  159. secondRs.update
  160. if Cint(s_picNumber)>0 then
  161. for i=0 to Cint(s_picNumber)
  162. if trim(request.Form("txt_PicNum_"&(i+1)))<>"" then
  163. Conn.execute("Insert into FS_HS_Picture (ID,HS_Type,PIC) values("&secondRs("sID")&",3,'"&request.Form("txt_PicNum_"&(i+1))&"')")
  164. End if
  165. next
  166. End if
  167. secondRs.close
  168. End if
  169. Conn.close
  170. User_Conn.close
  171. Set Conn=nothing
  172. Set User_Conn=nothing
  173. set secondRs=nothing
  174. if err.number=0 then
  175. Response.Redirect("../success.asp?ErrCodes=<li>操作成功!</li>&ErrorURL=House/HS_Second.asp")
  176. Response.End()
  177. Else
  178. Response.Redirect("../error.asp?ErrCodes=<li>请检查输入是否合法</li>")
  179. Response.End()
  180. End if
  181. %>