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

📄 addfinancialproject.asp

📁 企业内部办公管理信息系统 (一个用ASP开发的基于B/S方式的毕业设计)
💻 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("AddProject")) then
TheFinancialProjectName=Request.Form("FinancialProjectName")
TheAddDate=Date
'校验用户是否是财务部门的主管
if Session("Department")="财务部" and Session("Position")="主管" then
'从列表中选择新财务项目的负责人
if Request.form("RadioFinancialManager")="FromList" then
TheFinancialManager=Request.form("SelectFinancialManager")
'校验用户的输入是否合乎要求
if len(trim(theFinancialProjectName))=0 then
TheMessage="财务项目名称不能为空,请重填新财务项目名称"
Warning=true
else
'向数据库添加新财务项目
conn.Execute(" insert into FinancialProject (FinancialProjectName, AddDate, FinancialManager) "_
& "values (" _
& "'" & TheFinancialProjectName &"', '" & TheAddDate &"', '" & TheFinancialManager & "') ") 
TheMessage="财务项目已提交成功,请填写新财务项目"
Warning=false
end if
'用户自己输入新财务项目的负责人
else
Set RSDoExist=conn.execute("Select Name from PSLogins where Name='" _
& Request.form("TextFinancialManager")& "'")
'判断用户自己输入新财务项目的负责人是否存在
if RSDoExist.eof then
TheMessage="您输入的财务主管的姓名不存在(如果是新用户请添加用户信息)," _
& "无法添加财务项目。"
Warning=true
else
TheFinancialManager=RSDoExist("Name")
'向数据库添加新财务项目
conn.Execute(" insert into FinancialProject (FinancialProjectName, AddDate, FinancialManager) "_
& "values (" _
& "'" & TheFinancialProjectName &"', '" & TheAddDate &"', '" & TheFinancialManager & "') ") 
TheMessage="财务项目已提交成功,请填写新财务项目"
Warning=false
end if
end if
else
TheMessage="您不是财务部主管,无权添加财务项目"
Warning=true
end if
'删除某个财务项目
elseif not IsEmpty(Request.Form("DeleteProject")) then
'判断用户是否是财务部门主管
if Session("Department")="财务部" and Session("Position")="主管" then
conn.execute ("delete from FinancialProject where FinancialProjectID="_
& Request.Form("RadioFinancialProject"))
TheMessage="您已经删除了此财务项目"
else
TheMessage="您不是财务部主管,无权删除此财务项目"
Warning=true
end if
else
TheMessage = "请在下面填写新的财务项目"
end if
set RSPersons = conn.Execute("select Name from PSLogins order by Name")
set RSFinancialProjects=conn.Execute("select * 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 align=center cellpadding=2 cellspacing=1 bordercolor="#996633" bgcolor=#164DA8>
  <tr bgcolor=white>
    <td    valign=center bgcolor="#0066CC" > 
      <div align="center"><font color="#CCCCCC" size="+7" face="华文隶书"><strong>公司内部办公信息管理系统</strong></font></div></td>
  </tr>
</table>

<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
    <td height="13">&nbsp;</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"><font size="2">公司内部办公信息管理系统->公司财务信息管理系统->添加财务记录&nbsp->添加财务项目[当前用户-
        <% response.write Session("Name") %>
        ] </font></font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#104DAD" size="2">返回内网主页</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="AddFinancialRecord.asp"><font color="#104DAD" size="2">返回上一级网页</font></a></td>
</tr>
</table> 
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
    <td height="13">&nbsp;</td>
  </tr></table>
<br> 
 


<FORM ACTION="AddFinancialProject.asp"  METHOD=POST>

<TABLE CELLPADDING=1 CELLSPACING=2 BORDER=1 bordercolor="#164DA8" WIDTH=800 align=center>   
<TR VALIGN="center" ALIGN="center">
  <TD WIDTH=20% bgcolor=#B5C7EF>&nbsp;</td>
<td>

<table CELLPADDING=1 CELLSPACING=2 BORDER=0 align=center width=100% bgcolor=#B5C7EF>
<tr>
    <td ><font size="2">选中</font></td>
    <td ><font size="2">财务项目ID</font></td>
    <td><font size="2">财务项目名称</font></td>
    <td><font size="2">添加日期</font></td>
    <td><font size="2">项目主管</font></td>
  </tr>
  <font size="2">
  <% 
Do Until RSFinancialProjects.eof
Response.write "<tr bgcolor=white><td><input type=radio name=RadioFinancialProject value=" & RSFinancialProjects("FinancialProjectID") & "></td>"
Response.write "<td>" & RSFinancialProjects("FinancialProjectID") & "</td>"
Response.write "<td>" & RSFinancialProjects("FinancialProjectName") & "</td>"
Response.write "<td>" & RSFinancialProjects("AddDate") & "</td>"
Response.write "<td>" & RSFinancialProjects("FinancialManager") & "</td>"
RSFinancialProjects.movenext
loop
%>
  </font>
  <table>
    <br>
    <table CELLPADDING=1 CELLSPACING=1 BORDER=1 align=center width=100%>
      <tr>
        <td ><font size="2">财务项目名称</font></td>
        <td><font size="2">
          <INPUT TYPE="text"  NAME="FinancialProjectName" VALUE="" size=50>
          </font></td>
      </tr>
      <tr>
        <td width=25%><font color="#164DA8" size="2">此财务项目主管姓名</font></td>
        <td> <table width=100% border=1>
            <tr>
              <td width=55%> <font size="2">
                <INPUT TYPE="radio"  Checked NAME="RadioFinancialManager" VALUE="FromList" >
                <font color="#164DA8">从列表中选择此财务项目主管</font></font> </td>
              <td> <font size="2">
                <SELECT NAME="SelectFinancialManager" >
                  <%
Do Until RSPersons.EOF
%>
                  <OPTION VALUE="<% Response.Write RSPersons("Name") %>">
                  <% Response.Write RSPersons("Name") %>
                  </OPTION>
                  <%
RSPersons.Movenext
loop
%>
                </SELECT>
                </font></td>
            </tr>
            <tr>
              <td> <font size="2">
                <INPUT TYPE="radio"  NAME="RadioFinancialManager" VALUE="Input" >
                <font color="#164DA8">输入此财务项目主管</font></font> </td>
              <td> <font size="2">
                <INPUT TYPE="text"  NAME="TextFinancialManager" VALUE="" >
                </font></td>
            </tr>
          </table></td>
      </tr>
    </table>
    <font size="2"></td></font> <font size="2"></TR></font> 
  </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="AddProject" VALUE="添加此财务项目" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
	          <INPUT TYPE="submit" NAME="DeleteProject" VALUE="删除此财务项目" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
	          </TD>	
                          </TD>
                          </TR>
                          </table>
                          
<br>
</FORM>

 

 </BODY>
</HTML>

⌨️ 快捷键说明

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