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

📄 addfinancialrecord.asp

📁 企业及其分支机构的内部办公管理系统,包括人事
💻 ASP
字号:
<%@ Language=VBScript %>
<%
'判断用户是否登录
if isempty(Session("ID")) then
Response.Redirect "../login.asp"
end if
'判断用户是否是财务管理员
if Session("IsFinancialManager")=False then
Response.Redirect "Finance.asp"
end if
'连接系统数据库
set conn = server.createobject ("adodb.connection")
conn.open "ASPData", "sa", "yourpassword"
Warning=false 
'添加财务项目
if not IsEmpty(Request.Form("AddFinancialProject")) then
Response.Redirect "AddFinancialProject.asp"
end if
'添加财务记录信息
if not IsEmpty(Request.Form("AddRecord")) then
'从列表里选择财务记录经手人
if Request.Form("RadioFinancialRecordName")="FromList" then
TheName=Cstr(Request.Form("SelectFinancialRecordName"))
'用户自己输入财务记录经手人
else
TheName=Cstr(Request.Form("TextFinancialRecordName"))
end if
'从列表里选择财务记录所属项目
if Request.Form("RadioFinancialProject")="FromList" then
TheProjectName=Cstr(Request.Form("SelectFinancialProject"))
'用户自己输入财务记录所属项目
else
TheProjectName=Cstr(Request.Form("TextFinancialProject"))
end if
  '对用户输入的财务记录信息进行校验
if Len(Trim(TheName))=0  or Len(Trim(TheProjectName))=0 then
TheMessage="记录中记录经手人、记录隶属财务项目不能为空,无法添加此记录,请重填记录"
Warning=true
elseif not IsNumeric(Request.Form("FundTypeA")) or  _
          not IsNumeric(Request.Form("FundTypeB")) or  _
          not IsNumeric(Request.Form("FundTypeC")) or  _
          not IsNumeric(Request.Form("FundTypeD")) then
TheMessage="记录中的款项字段中出现了非数字内容,无法添加此记录,请重填记录"
Warning=true
else
TheFundTypeA=CCur(Request.Form("FundTypeA") )
TheFundTypeB=CCur(Request.Form("FundTypeB") )
TheFundTypeC=CCur(Request.Form("FundTypeC") )
TheFundTypeD=CCur(Request.Form("FundTypeD") )
TheSummary=Cstr(Request.Form("Summary"))
TheRemark=Cstr(Request.Form("Remark"))
TheAccountName=Cstr(Session("Name"))
TheDate=Date
TheSum=CCur(TheFundTypeA+TheFundTypeB+TheFundTypeC+TheFundTypeD)
  set RSDoExistName=conn.execute("select * from PSLogins where Name='" & TheName & "'")
  set RSDoExistProject=conn.execute("select * from FinancialProject where FinancialProjectName='"_
 & TheProjectName & "'")
'判断用户输入的财务记录经手人是否存在
if RSDoExistName.Eof then
TheMessage="您输入的记录中财务经手人不存在,请重新输入(如果是新员工请添加此员工记录)"
Warning=true
'判断用户输入的财务记录所属财务项目是否存在
elseif RSDoExistProject.Eof then
TheMessage="您输入的记录中财务项目不存在,请重新输入(如果是新项目,请添加财务项目)"
Warning=true
else
TheDepartment=RSDoExistName("Department")
'添加新财务记录到数据库
conn.Execute(" insert into FinancialRecord (Name, Department, ProjectName, "_
& "FundTypeA, FundTypeB, " _
& "FundTypeC, FundTypeD, Sum, Summary, Remark, AddDate, AccountName) values (" _
& "'" & TheName &"', " _
& "'" & TheDepartment &"', " _
& "'" & TheProjectName &"', " _
& "'" & TheFundTypeA &"', " _
& "'" & TheFundTypeB &"', " _
& "'" & TheFundTypeC &"', " _
& "'" & TheFundTypeD &"', " _
& "'" & TheSum &"', " _
& "'" & TheSummary &"', " _
& "'" & TheRemark &"', " _
& "'" & TheDate &"', " _
& "'" & TheAccountName & "') ") 	
TheMessage="记录已提交成功,请填写新记录"
Warning=false         
end if
end if
else
TheMessage = "请在下面填写新的财务记录"
Warning=false         
end if
set RSDepartments = conn.Execute("select  DepartmentName from Departments " _
& "order by DepartmentName")
set RSPersons = conn.Execute("select Name from PSLogins order by Name")
set RSFinancialProject=conn.Execute("select FinancialProjectName from FinancialProject"_
& " order by FinancialProjectName")
%>



<HTML>
<HEAD>
<TITLE>公司财务信息管理系统 </TITLE>
<META NAME="Generator" CONTENT="NetObjects Fusion 2.0.2 for Windows">

</HEAD>

<BODY BGCOLOR="">

<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr bgcolor=white><td    valign=center ><img src="../ASPLogo3.jpg" width=796 height=100></td></tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td></tr>
</table>
<br>

<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3>
<font color=white>
<P ALIGN="CENTER">公司内部办公信息管理系统->公司财务信息管理系统->添加财务记录&nbsp[当前用户-<% response.write Session("Name") %>]
</font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#104DAD">返回内网主页</font></a></td>
<td  align=center>
 <% if Warning=false then %>
 <font color="#104DAD" ><% response.write TheMessage %></FONT>
 <% else %>
 <font color=Red ><% response.write TheMessage %></font>
 <% end if %>
 </td>
<td  align=right><a href="Finance.asp"><font color="#104DAD">返回上一级网页</font></a></td>
</tr>
</table> 
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
    <tr> 
    <td height="10" colspan="4" valign="top" bgcolor="#FFFFFF"> 
    <table width="100%" border="0" height="13" cellspacing="0" cellpadding="0" mm_noconvert="TRUE">
    <tr> 
    <td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td>
    </tr>
    </table></td>
    </tr>
 </table>
 
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="3" cellspacing="0">
<tr><td>

<FORM ACTION="./AddFinancialRecord.asp"  METHOD=POST>

<br>

<TABLE CELLPADDING=1 CELLSPACING=2 BORDER=1 bordercolor="#164DA8" WIDTH=800 align=center>   
<TR VALIGN="center" ALIGN="center">
<TD WIDTH=20% bgcolor=#B5C7EF><img src="../image/finance1.jpg"></td>
<td>

<table CELLPADDING=1 CELLSPACING=1 BORDER=1 align=center width=100%>
<tr><td width=25%><font color="#164DA8">此财务记录经手人姓名</font></td><td>
<table width=100% border=1>
<tr><td width=55%>
<INPUT TYPE="radio"  Checked NAME="RadioFinancialRecordName" VALUE="FromList" ><font color="#164DA8">从列表中选择此财务记录经手人</font>
</td><td>
<SELECT NAME="SelectFinancialRecordName" >
<%
Do Until RSPersons.EOF
%>
<OPTION VALUE="<% Response.Write RSPersons("Name") %>"><% Response.Write RSPersons("Name") %></OPTION>
<%
RSPersons.Movenext
loop
%>		
</SELECT>
</td></tr>
<tr><td>
<INPUT TYPE="radio"  NAME="RadioFinancialRecordName" VALUE="Input" ><font color="#164DA8">输入的此财务记录经手人姓名</font> 
</td><td>
<INPUT TYPE="text"  NAME="TextFinancialRecordName" VALUE="" > 
</td></tr></table>
</td></tr>

<tr><td><font color="#164DA8">项目名称</font></td><td>
<table width=100% border=1>
<tr><td width=55%>
<INPUT TYPE="radio"  Checked NAME="RadioFinancialProject" VALUE="FromList" ><font color="#164DA8">从列表中选择此财务记录所属项目</font>
</td><td>
<SELECT NAME="SelectFinancialProject" >
<%
Do Until RSFinancialProject.EOF
%>	
<OPTION VALUE="<% Response.Write RSFinancialProject("FinancialProjectName") %>"><% Response.Write RSFinancialProject("FinancialProjectName") %></OPTION>
<%
RSFinancialProject.Movenext
loop
%>		
</SELECT>
</td></tr>
<tr><td>
<INPUT TYPE="radio"  NAME="RadioFinancialProject" VALUE="Input" ><font color="#164DA8">输入的此财务记录所属项目</font> 
</td><td>
<INPUT TYPE="text"  Checked NAME="TextFinancialProject" VALUE="" > 
</td></tr></table>
</td></tr>	  

         
<tr><td><font color="#164DA8">款项名称</font></td><td>

<table width=100% border=1>
<tr><td width=55%>
<font color="#164DA8">款项A</font>
</td><td>
<INPUT TYPE="text"  NAME="FundTypeA" VALUE="0" > 元
</td></tr>
<tr><td>
<font color="#164DA8">款项B</font>
</td><td>
<INPUT TYPE="text"   NAME="FundTypeB" VALUE="0" > 元
</td></tr>
<tr><td>
<font color="#164DA8">款项C</font>
</td><td>
<INPUT TYPE="text"   NAME="FundTypeC" VALUE="0" > 元
</td></tr>
<tr><td>
<font color="#164DA8">款项D</font>
</td><td>
<INPUT TYPE="text"   NAME="FundTypeD" VALUE="0" > 元
</td></tr>
</table> 	

</td></tr>
<tr><td ><font color="#164DA8">摘要</font></td><td><INPUT TYPE="text"  NAME="Summary" VALUE="" size=50> </td></tr>
<tr><td ><font color="#164DA8">备注</font></td><td><INPUT TYPE="text"  NAME="Remark" VALUE="" size=50> </td></tr>


<tr><td ><font color="#164DA8">会计经手人</font></td><td><% response.write Session("Name") %>&nbsp</td></tr>
</table>
</td>  
</TR>
</table>


                          <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=1 WIDTH=800 align=center>
                          <TR VALIGN="top" ALIGN="center">
	          <TD WIDTH=100% align=center >
	          <INPUT TYPE="submit" NAME="AddRecord" VALUE="添加此记录" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
	          <INPUT TYPE="reset" NAME="Reset" VALUE="重设此记录" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
	          <INPUT TYPE="submit" NAME="AddFinancialProject" VALUE="添加删除财务项目" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
	          
	          </TD>	
                          </TD>
                          </TR>
                          </table>
                          
<br>
</FORM>
</td></tr></table>
 

 </BODY>
</HTML>

⌨️ 快捷键说明

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