⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usertype.asp

📁 一个比较完整的企业erp系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
'   next
'end if
'oO.Close
'set oO = nothing
'Response.end
	   

                  isIdentifyCode_ = GetText("isIdentifyCode","P","number",1,2,0)
				  if isIdentifyCode_ = 0 then
				     Conn.Execute(SQLsalelist)
				     Conn.Execute(SQLsale)
				  else
				     Conn.Execute(SQLstock)
				  end if
				  Conn.Execute(SQLpayment)
                  Conn.Execute(SQLsupplier)
				  Conn.Execute(SQLs)
				  Conn.Execute(SQL)
				  Response.Write viewinfo("alertLoca","删除成功!",SELVAR("FN",""))

			 
			 Case "AddSub"
			      dim SELmainid
			      SELmainid = GetText("uTypeSelect","P","number",1,10,0)
				  SELmainid = SelectZD("select utypeid from usertype where utypeid = " & SELmainid & "","F")
				  if SELmainid = "F" then 
				     Response.Write viewinfo("alertLoca","不存在的主类.请重新选择主类!",SELVAR("FN",""))
					 Response.end
				  end if
				  identifyCode = isNumber(SelectZD("select identifyCode from usertype where utypeid=" & SELmainid & "",3),"int",3)
				  if identifyCode = 3 then
				     Response.Write viewinfo("alertLoca","未知错误!",SELVAR("FN",""))
					 Response.end
				  end if

			      SQLAdd = "insert into usertype (uTypeName,uTypeArray,uTypeSelect,uTypeRemark,identifyCode) values ('" & Replace(GetText("uTypeName","P","Str",1,110,"none"),"'","’") & "' , " & GetText("uTypeArray","P","number",1,10,0) & " , " & SELmainid & " , '" & Replace(GetText("uTypeRemark","P","Str",1,1000,"none"),"'","’") & "'," &identifyCode & ") "
				  Conn.Execute(SQLAdd)
				  Response.Write viewinfo("alertLoca","子类添加成功!",SELVAR("FN",""))
		     Case "updateSub"
			      RuTypeSelect = GetText("uTypeSelect","P","number",1,10,0)
				  identifyCode = SelectZD("select identifyCode from usertype where utypeid =" & RuTypeSelect & "",3)
				  if identifyCode = 3 then 
				     Response.Write viewinfo("alertLoca","未知错误!",SELVAR("FN",""))
					 Response.end
				  end if
				     
			      SQL = "update usertype Set uTypeName = '" & Replace(GetText("uTypeName","P","Str",1,110,"none"),"'","’") & "' , uTypeArray = " & GetText("uTypeArray","P","number",1,10,0) & " , uTypeSelect = " & RuTypeSelect & " , uTypeRemark = '"  & Replace(GetText("uTypeRemark","P","Str",1,1000,"none"),"'","’") & "' , identifyCode = " & identifyCode & " where utypeid = " & abs(GetText("utypeid","P","number",1,10,0)) & ""
			      Conn.Execute(SQL)
				  Response.Write viewinfo("alertLoca","子类修改成功!",SELVAR("FN",""))
			 Case "deleteSub"
			      uTypeid__ = abs(GetText("utypeid","P","number",1,10,0))
				  SQLs = "delete from usertype where uTypeid = " & uTypeid__ & ""
				  SQLstock = "delete from stock where supplierid  in(select uid from supplier where utypeid = " & uTypeid__ & ")"'''''OK

				  SQLsale = "delete from sale where supplierid  = " & uTypeid__ & ""'OK
				  SQLsalelist = "delete from salelist where saleid in(select saleid from sale where supplierid  = " & uTypeid__ & ")"'OK
				  SQLpayment = "delete from payment where supplierid in(select uid from supplier where utypeid = " & uTypeid__ & ")"

                  isIdentifyCode_ = GetText("isIdentifyCode","P","number",1,2,0)
				  if isIdentifyCode_ = 0 then
				     Conn.Execute(SQLsalelist)
				     Conn.Execute(SQLsale)
				  else
				     Conn.Execute(SQLstock)
				  end if
				  Conn.Execute(SQLs)
				  Conn.Execute(SQLpayment)
				  Response.Write viewinfo("alertLoca","子类-删除成功!",SELVAR("FN",""))
			      
		   End Select

	%>



   <form method='post' action="<%=SELVAR("FN","")%>">
   <input type = 'hidden' name = 'Options' value = 'AddSub'/>
     <tr>
	   <td style = 'height:25px;width:45px;text-align:right;'>序号&nbsp;</td>
	   <td style = 'width:100px;'>子类名</td>
	   <td style = 'width:30px;'>排列</td>
	   <td style = 'width:50px;'>已有数量</td>
	   <td style = 'width:80px;'>所属主类</td>
	   <td style = 'width:80px;'>所属</td>
	   <td style = 'width:auto;'>备注</td>
	   <td style = 'width:88px;'>&nbsp;</td>
	 </tr>
     <tr>
	   <td style = 'text-align:right;'>新加&nbsp;</td>
	   <td><input type="text" name="uTypeName" style = 'width:100%;' class = 'input'/></td>
	   <td><input type = 'text' name = 'uTypeArray' style = 'width:100%;' class = 'input'/></td>
	   <td>&nbsp;</td>
	  <%SQL = ("select * From usertype where uTypeSelect = 0 Order By identifyCode , utypeid Desc")%> <td><%=usertype(SQL,GetText("RuTypeSelect","P","number",1,10,0),"100%","uTypeSelect","")%></td>
	   <td>&nbsp;</td>
	   <td><input type = 'text' name = 'uTypeRemark' style = 'width:100%;' class = 'input'/></td>
	   <td><input type="submit" value = '新添加子类' style = 'width:72px;'></td>
	 </tr>
    </form>
	<%

	  SQL = ("select * From usertype where not uTypeSelect = 0 Order By uTypeSelect , utypeid Desc")
	    Rs.Open(SQL),Conn,1,1
		   if not Rs.eof then
		      for i = 1 to Rs.RecordCount
			      utypeid = Rs("utypeid")
				  utypeid_ = utypeid
				  uTypeName = Rs("uTypeName")
				  uTypeArray = Rs("uTypeArray")
                  uTypeSelect = Rs("uTypeSelect")
				  AboutSub = DataCount("select count(utypeid) from usertype where utypeid = " & uTypeSelect & "",0)
				  uTypeRemark = Rs("uTypeRemark")
				  supplierCount = DataCount("select count(uid) from supplier where utypeid = " & utypeid & "",0) '该子类的注册用户数

				  deleteButton = "<input type = 'submit' onclick = ""javascript:forms" & i & ".Options.value = 'deleteSub';return confirm('即将彻底删除类别:(" & uTypeName & ")及与其相关的所有商品记录.\n\n此操作不可撤消.是否继续?');return true;"" value = '删除'/>"
                  ismainSQL = "select * from usertype where uTypeSelect = 0 "

				  isIdentifyCode = isNumber(SelectZD("select identifyCode from usertype where uTypeid = " & uTypeSelect & "",3),"int",0)

				  Response.Write"" &_
				  "<form method = 'post' action='" & SELVAR("FN","") & "' name = 'forms" & i & "'>" &_
				  "<input name = 'Options' type = 'hidden'/><input type = 'hidden' value = '" & isIdentifyCode & "' name = 'isIdentifyCode'/>" & _
				  "<input name = 'utypeid' type = 'hidden' value = '" & utypeid & "'/>" & _
				  "<tr>" &_
				  "<td style = 'text-align:right;'>" & utypeid & "&nbsp;</td>" & _
				  "<td><input type = 'text' name = 'uTypeName' value = '" & uTypeName & "' style = 'width:100%;' class = 'input'/></td>" & _
				  "<td><input type = 'text' name = 'uTypeArray' value = '" & uTypeArray & "' style = 'width:100%;' class = 'input'/></td>" & _
				  "<td style = 'text-align:center;'>" & supplierCount & "</td>" &_
				  "<td>" & usertype(ismainSQL,uTypeSelect,"100%","uTypeSelect","") & "</td>" & _
				  "<td>" & v1v2(isIdentifyCode,0,"客户","商家") & "</td>" & _
				  "<td><input type = 'text' name = 'uTypeRemark' value = '" & uTypeRemark & "' style = 'width:100%;' class = 'input'/></td>" & _
				  "<td><input type = 'submit' value = '修改' onclick = ""javascript:forms" & i &".Options.value = 'updateSub';""/>" & deleteButton & "</td>" &_
				  "</tr>" & _
				  "</form>"
				  Rs.movenext
			  Next
		   else
		      Response.Write"<tr><td colspan = '8' style = 'color:red;text-align:center;'>请先添加一个用户子类!</td></tr>"
		   end if
		   Rs.Close
ConnClose()
%>
 </table>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -