HS_Quotation_Open_Action.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="../../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.   ' Powered by: FoosunCMS4.0系列,Company:Foosun Inc
  10. Dim house_rs,action,id,res,sqlstatement,i,pic_rs
  11. Dim hs_HouseName,hs_Position,hs_Direction,hs_Class,hs_OpenDate,hs_PreSaleNumber,hs_IssueDate,hs_PreSaleRange,hs_Status,hs_Price,hs_PubDate,hs_tel,hs_UserNumber,hs_Audited,hs_editor,hs_picNumber,hs_introduction
  12. action=request.QueryString("action")
  13. id=NoSqlHack(request("id"))
  14. response.Charset="GB2312"
  15. if action="delete" then
  16. Conn.execute("Delete from FS_HS_Quotation where id in("&id&")")
  17. Conn.execute("Delete from FS_HS_Picture where id in("&id&")")
  18. Response.Write("ok")
  19. response.End()
  20. elseif action="add" then
  21. Set house_rs=Server.CreateObject(G_FS_RS)
  22. sqlstatement="select ID,HouseName,Position,Direction,Class,OpenDate,PreSaleNumber,IssueDate,PreSaleRange,Status,Price,PubDate,Tel,Click,UserNumber,Audited,editor,picNumber,introduction from FS_HS_Quotation"
  23. hs_HouseName=trim(request.Form("txt_HouseName"))
  24. hs_Position=trim(request.Form("txt_Position"))
  25. hs_Direction=trim(request.Form("txt_Direction"))
  26. hs_Class=trim(request.Form("txt_Class"))
  27. hs_OpenDate=trim(request.Form("txt_OpenDate"))
  28. hs_PreSaleNumber=trim(request.Form("txt_PreSaleNumber"))
  29. hs_IssueDate=trim(request.Form("txt_IssueDate"))
  30. hs_PreSaleRange=trim(request.Form("txt_PreSaleRange"))
  31. hs_Status=trim(request.Form("sel_Status"))
  32. hs_Price=trim(request.Form("txt_Price"))
  33. hs_PubDate=trim(request.Form("txt_PubDate"))
  34. hs_tel=trim(request.Form("txt_tel"))
  35. hs_UserNumber=session("FS_UserNumber")
  36. hs_Audited=0
  37. hs_editor=Session("Admin_Name")
  38. hs_introduction=request.Form("txt_introduction")
  39. house_rs.open sqlstatement,Conn,1,3
  40. house_rs.addnew
  41. house_rs("HouseName")=hs_HouseName
  42. house_rs("Position")=hs_Position
  43. house_rs("Direction")=hs_Direction
  44. house_rs("Class")=hs_Class
  45. if hs_OpenDate<>"" then house_rs("OpenDate")=hs_OpenDate
  46. house_rs("PreSaleNumber")=hs_PreSaleNumber
  47. if hs_IssueDate<>"" then house_rs("IssueDate")=hs_IssueDate
  48. house_rs("PreSaleRange")=hs_PreSaleRange
  49. if hs_Status="" then hs_Status=1
  50. house_rs("Status")=hs_Status
  51. if hs_price="" then hs_price=0
  52. house_rs("Price")=hs_Price
  53. if hs_PubDate<>"" then house_rs("PubDate")=hs_PubDate
  54. house_rs("tel")=hs_tel
  55. house_rs("Click")=0
  56. house_rs("UserNumber")=hs_UserNumber
  57. house_rs("Audited")=hs_Audited
  58. house_rs("editor")=hs_editor
  59. house_rs("introduction")=hs_introduction
  60. hs_picNumber=trim(request.Form("txt_PicNum"))
  61. if hs_picNumber="" then hs_picNumber=0
  62. house_rs("picNumber")=hs_picNumber
  63. house_rs.update
  64. if Cint(hs_picNumber)>0 then
  65. for i=0 to Cint(hs_picNumber)
  66. if trim(request.Form("txt_PicNum_"&(i+1)))<>"" then
  67. Conn.execute("Insert into FS_HS_Picture (ID,HS_Type,PIC) values("&house_rs("ID")&",1,'"&request.Form("txt_PicNum_"&(i+1))&"')")
  68. End if
  69. next
  70. End if
  71. house_rs.close
  72. elseif action="edit" then
  73. Set house_rs=Server.CreateObject(G_FS_RS)
  74. sqlstatement="select ID,HouseName,Position,Direction,Class,OpenDate,PreSaleNumber,IssueDate,PreSaleRange,Status,Price,PubDate,Tel,Click,UserNumber,Audited,editor,picNumber,introduction from FS_HS_Quotation where id="&id
  75. hs_HouseName=trim(request.Form("txt_HouseName"))
  76. hs_Position=trim(request.Form("txt_Position"))
  77. hs_Direction=trim(request.Form("txt_Direction"))
  78. hs_Class=trim(request.Form("txt_Class"))
  79. hs_OpenDate=trim(request.Form("txt_OpenDate"))
  80. hs_PreSaleNumber=trim(request.Form("txt_PreSaleNumber"))
  81. hs_IssueDate=trim(request.Form("txt_IssueDate"))
  82. hs_PreSaleRange=trim(request.Form("txt_PreSaleRange"))
  83. hs_Status=trim(request.Form("sel_Status"))
  84. hs_Price=trim(request.Form("txt_Price"))
  85. hs_PubDate=trim(request.Form("txt_PubDate"))
  86. hs_tel=trim(request.Form("txt_tel"))
  87. hs_UserNumber=session("FS_UserNumber")
  88. hs_Audited=0
  89. hs_editor=Session("Admin_Name")
  90. hs_introduction=request.Form("txt_introduction")
  91. house_rs.open sqlstatement,Conn,1,3
  92. house_rs("HouseName")=hs_HouseName
  93. house_rs("Position")=hs_Position
  94. house_rs("Direction")=hs_Direction
  95. house_rs("Class")=hs_Class
  96. if hs_OpenDate<>"" then house_rs("OpenDate")=hs_OpenDate
  97. house_rs("PreSaleNumber")=hs_PreSaleNumber
  98. if hs_IssueDate<>"" then house_rs("IssueDate")=hs_IssueDate
  99. house_rs("PreSaleRange")=hs_PreSaleRange
  100. if hs_Status="" then hs_Status=1
  101. house_rs("Status")=hs_Status
  102. if hs_price="" then hs_price=0
  103. house_rs("Price")=hs_Price
  104. if hs_PubDate<>"" then house_rs("PubDate")=hs_PubDate
  105. house_rs("tel")=hs_tel
  106. house_rs("Click")=0
  107. house_rs("UserNumber")=hs_UserNumber
  108. house_rs("Audited")=hs_Audited
  109. house_rs("editor")=hs_editor
  110. house_rs("introduction")=hs_introduction
  111. hs_picNumber=trim(request.Form("txt_PicNum"))
  112. if hs_picNumber="" then hs_picNumber=0
  113. house_rs("picNumber")=hs_picNumber
  114. house_rs.update
  115. house_rs.close
  116. Conn.execute("Delete from FS_HS_Picture where  HS_type=1 and id="&id)
  117. if Cint(hs_picNumber)>0 then
  118. for i=0 to Cint(hs_picNumber)
  119. if trim(request.Form("txt_PicNum_"&(i+1)))<>"" then
  120. Conn.execute("Insert into FS_HS_Picture (ID,HS_Type,PIC) values("&id&",1,'"&request.Form("txt_PicNum_"&(i+1))&"')")
  121. End if
  122. next
  123. End if
  124. End if
  125. User_Conn.close
  126. Conn.close
  127. Set pic_rs=nothing
  128. Set house_rs=nothing
  129. Set Conn=nothing
  130. Set User_Conn=nothing
  131. if err.number=0 then
  132. Response.Write("ok")
  133. Response.Redirect("lib/success.asp?ErrCodes=<li>操作成功</li>&ErrorURL=../houseManage.asp")
  134. Response.End()
  135. Else
  136. Response.Redirect("lib/error.asp?ErrCodes=<li>请检查输入是否合法</li>")
  137. Response.End()
  138. End if
  139. %>