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

📄 newproduct.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")

if request("id")<>"" then
	objcheck.CheckUserFunction "product","edit"
else
	objcheck.CheckUserFunction "product","add"
end if
set objcheck=nothing

if request("id")<>"" then
	dim connq
	dim rsq
	set connq=server.CreateObject("adodb.connection")
	set rsq=server.CreateObject("adodb.recordset")
	connq.Open connstring
	rsq.Open "select * from v_product where productid="&request("id"),connq,2,3,1
	strproductcode=rsq("productcode")
	strmodel=rsq("model")
	strname=rsq("name")
	strenglishname=rsq("englishname")
	strcurrencycode=rsq("currencycode")
	strum=rsq("um")
	strcost=rsq("cost")
	strManufacturer=rsq("Manufacturer")
	strManufacturername=getfieldvalue("v_account","accountid",rsq("Manufacturer"),"account")
	strSupplier=rsq("Supplier")
	strSuppliername=getfieldvalue("v_account","accountid",rsq("Supplier"),"account")
	strprice=rsq("price")
	strproducttype=rsq("producttypeid")	
	strproducttypename=rsq("producttype")
	set rsw=connq.execute("select id,name from userdefine where definetype='产品类型' and name in(select definetype from userdefine where name='"&strproducttypename&"')")
	if not rsw.eof then 
		strproducttype2=rsw("id")
		strproducttypename2=rsw("name")
	else 
		strproducttype2=-1
		strproducttypename2=""
	end if	
'	response.write "select id from userdefine where definetype='产品类型' and name in(select definetype where name='"&strproducttypename&"')"
	strRetail_Price=rsq("Retail_Price")
	strshortkey=rsq("shortkey")
	strspecialprice=rsq("specialprice")
	strspecialpriceno=rsq("specialpriceno")
	strdescription=rsq("description")
	strdisable=rsq("disable")
	stronwhsestatus=rsq("onwhsestatus")
	rsq.Close
	set rsq=nothing
	connq.Close
	set connq=nothing
end if

if request("productcode")<>"" then
	Dim objproduct
	Set objproduct=Server.CreateObject("SmartSales.Product")
	objproduct.SaveProduct
	set objproduct=nothing
	%>
		<script language=javascript>
			window.opener.location.reload();
			window.close();
		</script>
	<%
end if
%>
<HTML><HEAD><TITLE><%if request("id")="" then%>新建产品<%else%>编辑产品<%end if%></TITLE>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script language="javascript">
function save(){
	if (document.all.Tr2name.style.display==""){
		document.all.type.value=document.all.serialsubtype.value
	}
	if (form1.productcode.value==''){
		alert('请输入货号!');
		form1.productcode.focus();
		return;
	}
	if (form1.name.value==''){
		alert('请输入名称!');
		form1.name.focus();
		return;
	}	
	if (form1.model.value==''){
		alert('请输入型号!');
		form1.model.focus();
		return;
	}
	if (form1.shortkey.value==''){
		alert('请输入助记符!');
		form1.shortkey.focus();
		return;
	}
	if (form1.cost.value==''){
		alert('请输入成本!');
		form1.cost.focus();
		return;
	}
	if (form1.price.value==''){
		alert('请输入价格!');
		form1.price.focus();
		return;
	}
	if (form1.retail_price.value==''){
		alert('请输入市场价!');
		form1.retail_price.focus();
		return;
	}
	if (form1.producttype.value==-1){
		alert('请选择产品类型!');
		form1.producttype.focus();
		return;
	}
	if (document.all.type.value==-1){
		alert("产品子类型不能为空!");
		return false;
	}	
form1.submit();
}

function remotesubtype(){
	form1.type.value=-1;
	inner.location.href = "/tools/remotevalue.asp?theId="+form1.producttype.value;
}
function settype(thevalue){
	var thevalue
	form1.type.value=thevalue;
}
</script>
<body>
 <form name=form1  method="post"  id=form1>
 <input name='type' type='hidden' value=-1>
 <iframe id="inner" width="0" height="0"></iframe>
     <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
   <tr> 
      <td height="25"><strong><font size="2" class=title><b><%if request("id")="" then%>新建产品<%else%>编辑产品<%end if%></b></font></strong></td>
      <td>&nbsp;</td>
    </tr>
    <tr > 
      <td height="16" colspan="2" background="../images/title.gif">&nbsp;</td>
    </tr>
    <tr>
      <td height=4></td>
    </tr>
	<tr><td><div align="center" style="cursor:hand">
			<a onclick="save();"><img src="../images/button_save.gif"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="window.close();"><img src="../images/button_cancel.gif"></a></DIV></td>
    </tr>
 </table>

  <table width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
    <tr> 
      <td width="15%" bgcolor="DEDFDE"><div align="center"><font color=red>*&nbsp;</font>货号</div></td>
      <td colspan=3 bgcolor="EFEFEF" > 
        <%if 1=1 then 'request("id")="" then%>
        <input name=productcode type=text value="<%=strproductcode%>" size="30"> 
        <%else%>
        <font color=red><%=strproductcode%></font> <input name=productcode2 type=hidden value="<%=strproductcode%>" size="20"> 
        <%end if%>
      </td>
      <td width="15%" bgcolor="DEDFDE"><div align="center"><font color=red>*&nbsp;</font>名称</div></td>
      <td width="19%" bgcolor="EFEFEF"><input name=name type=text value="<%=strname%>" size="20"> 
      </td>
    </tr>
    <tr> 
      <td width="15%" nowrap bgcolor="DEDFDE"> <div align="center"><font color=red>*&nbsp;</font>型号</div></td>
      <td colspan="3" bgcolor="EFEFEF"> <input name=model type=text value="<%=strmodel%>" size="30"> 
        <div align="center"></div></td>
      <td width="15%" bgcolor="DEDFDE"><div align="center">英文名称 </div></td>
      <td width="19%" bgcolor="EFEFEF"><input name=englishname type=text value="<%=strenglishname%>" size="20"></td>
    </tr>
    <tr> 
      <td width="15%" bgcolor="DEDFDE" > <div align="center">货币</div></td>
      <td width="18%" bgcolor="EFEFEF"> <select name=CurrencyCode>
          <option value=-1>--选择货币--</option>
          <%getdefine "货币",strCurrencyCode%>
        </select> </td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center">单位</div></td>
      <td width="18%" bgcolor="EFEFEF"> <select name=UM>
          <option value=-1>--选择单位--</option>
          <%getdefine "单位",strUM%>
        </select></td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center"><font color=red>*&nbsp;</font>助记符</div></td>
      <td width="19%" bgcolor="EFEFEF"><input name=shortkey type=text value="<%=strshortkey%>" size="14"> 
      </td>
    </tr>
    <tr> 
      <td width="15%" height="25" bgcolor="DEDFDE" > <div align="center"><font color=red>*&nbsp;</font>参考成本</div></td>
      <td width="18%" bgcolor="EFEFEF"><input name=cost type=text value="<%=strcost%>" size="14"> 
      </td>
      <td width="15%" bgcolor="DEDFDE"><div align="center"><font color=red>*&nbsp;</font>销售价格</div></td>
      <td width="18%" bgcolor="EFEFEF"> <input name=price type=text value="<%=strprice%>" size="14"></td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center">制造商</div></td>
      <td width="19%" bgcolor="EFEFEF"><input name="Manufacturer" type="hidden" size="8" value="<%=strManufacturer%>"> 
        <input name="Manufacturername" type="text" size="16" value="<%=strManufacturername%>" readonly> 
        <input type="button" name="bnManufacturer" onClick="JavaScript:opensubwin2('form1','Manufacturer')"    value=...  class=black></td>
    </tr>
    <tr> 
      <td bgcolor="DEDFDE" ><div align="center"><font color=red>*&nbsp;</font>产品类型</div></td>
      <td bgcolor="EFEFEF"><select name=producttype  onChange="remotesubtype();">
          <option value=-1>--产品类型--</option>
          <%getdefine "产品类型",strproducttype2%>
        </select> </td>
      <td bgcolor="DEDFDE"><div align="center"><font color=red>*&nbsp;</font>市场价格</div></td>
      <td bgcolor="EFEFEF"><input name=retail_price type=text value="<%=strRetail_Price%>" size="14"></td>
      <td bgcolor="DEDFDE"><div align="center">供应商</div></td>
      <td bgcolor="EFEFEF"><input name="Supplier" type="hidden" size="8" value="<%=strSupplier%>"> 
        <input name="Suppliername" type="text" size="16" value="<%=strSuppliername%>" readonly> 
        <input type="button" name="bnSupplier" onClick="JavaScript:opensubwin2('form1','Supplier')"    value=...  class=black></td>
    </tr>
    <tr id="Tr2name">
      <td bgcolor="DEDFDE" ><div align="center"><font color=red>*&nbsp;</font>产品子类</div></td>
      <td bgcolor="EFEFEF"><select name=serialsubtype class="formatselect">
          <option value=-1>--子类型--</option>
          <%getdefine strproducttypename2,strproducttype%>
        </select></td>
      <td bgcolor="DEDFDE">&nbsp;</td>
      <td bgcolor="EFEFEF">&nbsp;</td>
      <td bgcolor="DEDFDE">&nbsp;</td>
      <td bgcolor="EFEFEF">&nbsp;</td>
    </tr>
    <tr id="Tr1name" style="display:none"> 
      <td width="15%" bgcolor="DEDFDE" > <div align="center"><font color=red>*&nbsp;</font>产品子类</div></td>
      <td width="18%" bgcolor="EFEFEF"><div id="Trname" style="display:none"></div></td>
      <td width="15%" bgcolor="DEDFDE"><div align="center"></div></td>
      <td width="18%" bgcolor="EFEFEF">&nbsp;</td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center"></div></td>
      <td width="19%" bgcolor="EFEFEF">&nbsp;</td>
    </tr>
    <tr> 
      <td width="15%" bgcolor="DEDFDE" rowspan=4> <div align="center">描述</div></td>
      <td colspan="3" rowspan=4 bgcolor="EFEFEF"> <textarea name="description" cols="40" rows="4"><%=strdescription%></textarea> 
      </td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center">失效 </div></td>
      <td width="18%" bgcolor="EFEFEF"><input type="checkbox" name="disable" value=1 <%if strdisable=true then Response.Write "checked"%>> 
      </td>
    </tr>
    <tr> 
      <td bgcolor="DEDFDE"><div align="center">在库状态</div></td>
      <td width="18%" bgcolor="EFEFEF"><select name=onwhsestatus>
          <option value=-1>--选择在库状态--</option>
          <%getdefine "在库状态",stronwhsestatus%>
        </select></td>
    </tr>
  </table>
</form>

⌨️ 快捷键说明

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