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

📄 addcaiwu.asp

📁 办公自动化系统
💻 ASP
字号:
<%@ Language=VBScript %>
<!--#include file="conn.asp"-->
<%
'判断用户是否登录
if isempty(Session("ID")) then
Response.Redirect "../login.asp"
end if
'判断用户是否是财务管理员
if Session("IsFinancialManager")=False then
Response.Redirect "Finance.asp"
end if
Warning=false 
'添加财务项目
if not IsEmpty(Request.Form("AddFinancialProject")) then
Response.Redirect "Addxiangmu.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 UserInfo 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 UserInfo 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>

<table width=800 height="56" border=0 align=center cellpadding=2 cellspacing=1 bgcolor=#9966FF>
<tr bgcolor=white><td height="41"    valign=center bgcolor="#9966FF" ><div align="center"><strong><font color="#FFFFFF" size="4">企业办公自动化系统</font></strong></div></td>
</tr>
</table>

<table width=800 border=0 bgcolor=#9999FF cellspacing=1 cellpadding=2 align=center>
<tr bgcolor="#99CCFF"><td colspan=3>
<P ALIGN="CENTER"><font color="#9900FF">公司办公管理系统->公司财务管理系统->添加财务记录当前用户-
      <% response.write Session("Name") %>
      </font></td></tr>
<tr bgcolor=white >
<td width="183"><a href="../html/home.asp"><font color="#9900FF">返回主页</font></a></td>
<td width="606"  align=center>
  <div align="left">
      <% if Warning=false then %>
      <font color="#9900FF" >
      <% response.write TheMessage %>
      </FONT>
      <% else %>
      <font color="#9900FF" >
      <% response.write TheMessage %>
      </font>
      <% end if %>
  </div></td>

</tr>
</table> 

<FORM ACTION="Addcaiwu.asp"  METHOD=POST> 
<table width="800" border="0" bordercolor="#9999FF" align="center" cellpadding="3" cellspacing="0">






<TABLE CELLPADDING=1 CELLSPACING=2 BORDER=1 bordercolor="#9900FF" WIDTH=800 align=center>   
<TR VALIGN="center" ALIGN="center">
<TD WIDTH=20% bgcolor=#B5EFC7><img src="../image/HomepagePicture1.jpg" width="250" height="173"></td>
<td>

<table CELLPADDING=1 CELLSPACING=1 BORDER=1 align=center width=100%>
<tr><td width=25%><font color="#9900FF">此财务记录经手人姓名</font></td><td>
<table width=100% border=1>
<tr><td width=55%>
<INPUT TYPE="radio"  Checked NAME="RadioFinancialRecordName" VALUE="FromList" ><font color="#9900FF">从列表中选择此财务记录经手人</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="#9900FF">输入的此财务记录经手人姓名</font> 
</td><td>
<INPUT TYPE="text"  NAME="TextFinancialRecordName" VALUE="" > 
</td></tr></table>
</td></tr>

<tr><td><font color="#9900FF">项目名称</font></td><td>
<table width=100% border=1>
<tr><td width=55%>
<INPUT TYPE="radio"  Checked NAME="RadioFinancialProject" VALUE="FromList" ><font color="#9900FF">从列表中选择此财务记录所属项目</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="#9900FF">输入的此财务记录所属项目</font> 
</td><td>
<INPUT TYPE="text"  Checked NAME="TextFinancialProject" VALUE="" > 
</td></tr></table>
</td></tr>	  

         
<tr><td><font color="#9900FF">款项名称</font></td><td>

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

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


<tr><td ><font color="#9900FF">会计经手人</font></td><td><% response.write Session("Name") %></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="添加信息">
	          
	          <INPUT TYPE="submit" NAME="AddFinancialProject" VALUE="添加删除项目" >
	          
	          </TD>	
                          </TD>
                          </TR>
                          </table>
                          


</td></tr></table>
 
</FORM>
</BODY>
</HTML>

⌨️ 快捷键说明

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