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

📄 danwei_add.asp

📁 财务预算管理 财务支出
💻 ASP
字号:
<!--#include file="sysconfig.asp"-->
<!--#include file="Inc/Function.asp"-->

<%
'黄华于2008年3月
%>

<%
dim Action,guikou_id,danwei_name,rs,FoundErr,ErrMsg
Action=trim(Request("Action"))
guikou_id=trim(request("guikou_id"))
danwei_name=trim(request("danwei_name"))

if Action="Add" then
	if guikou_id="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>归口名不能为空!</li>"
	end if
	if danwei_name="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>单位名不能为空!</li>"
	end if
	if FoundErr<>True then
		Set rs=Server.CreateObject("Adodb.RecordSet")
		if yzcv<>zcv then response.end
		rs.open "Select * from danwei Where guikou_id='" & guikou_id & "'AND danwei_name='" & danwei_name & "'",conn,1,3
		if not rs.EOF then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>“" & guikou_name & "”中已经存在单位“" & danwei_name & "”!</li>"
		else
     		rs.addnew
			rs("guikou_id")=guikou_id
    	 	rs("danwei_name")=danwei_name
		    rs("cost_delete")=0
     		rs.update
	     	rs.Close
    	 	set rs=Nothing
     		call CloseConn()
			Response.Redirect "Class.asp"  
		end if
	end if
end if
if FoundErr=True then
	call WriteErrMsg()
else
%>
<script language="JavaScript" type="text/JavaScript">
function checkSmall()
{
  if (document.form2.guikou_name.value=="")
  {
    alert("请先添加归口名称!");
	document.form1.guikou_name.focus();
	return false;
  }

  if (document.form2.danwei_name.value=="")
  {
    alert("单位名称不能为空!");
	document.form2.danwei_name.focus();
	return false;
  }
}
</script>
<!-- #include file="Inc/Head.asp" -->
<BR>
<table cellpadding="2" cellspacing="1" border="0" width="360" align="center" class="a2">
	<tr>
		<td class="a1" height="25" align="center"><strong>预 算 类 别 设 置</strong></td>
	</tr>
	<tr class="a4">
		<td align="center">
			<BR>
			<form name="form2" method="post" action="danwei_Add.asp" onSubmit="return checkSmall()">
			<table width="350" border="0" align="center" cellpadding="0" cellspacing="2" class="border">
				<tr bgcolor="#999999" class="title"> 
					<td height="25" colspan="2" align="center"><strong>添加单位</strong></td>
				</tr>
				<tr class="tdbg"> 
					<td width="126" height="22" bgcolor="#C0C0C0" align=right><strong>所属业务科室:</strong></td>
					
            <td width="218" bgcolor="#E3E3E3"> 
              <%set rsguikou=conn.execute("select * from guikou where id="&guikou_id&"")%>
              <%=rsguikou("guikou_name")%> <input name="guikou_id"  id="guikou_id" type="hidden"value=<%=rsguikou("id")%>> 
            </td>
				</tr>
				<tr class="tdbg"> 
					<td width="126" height="22" bgcolor="#C0C0C0" align=right><strong>单位名称:</strong></td>
					<td bgcolor="#E3E3E3"><input name="danwei_name" type="text" size="20" maxlength="30"></td>
				</tr>
				<tr class="tdbg"> 
					<td height="22" align="center" bgcolor="#C0C0C0">&nbsp; </td>
					<td height="22" align="center" bgcolor="#E3E3E3"><div align="left"
><input name="Action" type="hidden" id="Action3" value="Add"><input name="Add" type="submit" value=" 添 加 "></div></td>
				</tr>
			</table>
			</form>
		</td>
	</tr>
</table>
<BR>
<%htmlend%>
<%
end if
call CloseConn()
%>

⌨️ 快捷键说明

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