?? modifyfinancialrecord.asp
字號(hào):
<%@ Language=VBScript %>
<!--#include file="../conn.asp"-->
<%
'判斷用戶是否登錄
if isempty(Session("ID")) then
Response.Redirect "../login.asp"
end if
'判斷用戶是否具有財(cái)務(wù)管理員身份
if Session("IsFinancialManager")=False then
Response.Redirect "Finance.asp"
end if
'連接系統(tǒng)數(shù)據(jù)庫
'set conn = server.createobject ("adodb.connection")
'conn.open "ASPData", "sa", ""
Warning=false
'查詢某個(gè)財(cái)務(wù)記錄
if not IsEmpty(Request.Form("Query")) then
'獲得用戶的查詢條件
if Request.Form("QueryCheck1")="on" and len(trim(Request.Form("FinancialRecordID")))<>0 then
sql1="and ID=" & Request.Form("FinancialRecordID")
else
sql1=" "
end if
if Request.Form("QueryCheck2")="on" and len(trim(Request.Form("FinancialProjectName")))<>0 then
sql2=" and ProjectName='" & Request.Form("FinancialProjectName") & "'"
else
sql2=" "
end if
if Request.Form("QueryCheck3")="on" then
sql3=" and Name='" & Request.Form("SelectName") & "'"
else
sql3=" "
end if
if Request.Form("QueryCheck4")="on" then
TheAddDate=Request.Form("AddYear") &"-" & Request.Form("AddMonth") & "-" _
& Request.Form("AddDay")
sql4=" and AddDate=#"& TheAddDate &"# "
else
sql4=" "
end if
set RSRecordResult=conn.Execute("select * from FinancialRecord where AccountName='" _
& Session("Name") &"' " & sql1 & sql2 & sql3 & sql4 &" order by Name")
TheMessage="您查詢的財(cái)務(wù)記錄如下"
QueryLabel=2
'用戶選定了查詢出來的某個(gè)財(cái)務(wù)記錄
elseif not IsEmpty(Request.Form("SelectRecord")) then
TheMessage="請(qǐng)?jiān)谙旅嫘薷拇藯l財(cái)務(wù)記錄"
set RSThisRecord=conn.Execute("select * from FinancialRecord" _
& " where ID="&Request.Form("RadioFinancialRecord"))
QueryLabel=3
'用戶對(duì)選定的財(cái)務(wù)記錄進(jìn)行了更新
elseif not IsEmpty(Request.Form("UpdateRecord")) then
'校驗(yàn)用戶的輸入
if not IsNumeric(Request.Form("UpdateFundTypeA")) or _
not IsNumeric(Request.Form("UpdateFundTypeB")) or _
not IsNumeric(Request.Form("UpdateFundTypeC")) or _
not IsNumeric(Request.Form("UpdateFundTypeD")) then
TheMessage="記錄中的款項(xiàng)字段中出現(xiàn)了非數(shù)字內(nèi)容,無法修改此記錄,請(qǐng)重填記錄"
Warning=true
QueryLabel=3
else
set RSLinkedDepartment=conn.Execute("select Department from UserInfo where Name='" _
& Request.Form("UpdateName") & "'")
TheName=Request.Form("UpdateName")
TheDepartment=RSLinkedDepartment("Department")
TheProjectName=Request.Form("UpdateProjectName")
TheFundTypeA=CCur(Request.Form("UpdateFundTypeA"))
TheFundTypeB=CCur(Request.Form("UpdateFundTypeB"))
TheFundTypeC=CCur(Request.Form("UpdateFundTypeC"))
TheFundTypeD=CCur(Request.Form("UpdateFundTypeD"))
TheSummary=Cstr(Request.Form("UpdateSummary"))
TheRemark=Cstr(Request.Form("UpdateRemark"))
TheModifyDate=Date
TheSum=CCur(TheFundTypeA+TheFundTypeB+TheFundTypeC+TheFundTypeD)
'修改此條財(cái)務(wù)記錄
conn.execute "update FinancialRecord set "_
& "Name='" & TheName & "', "_
& "Department='" & TheDepartment & "', "_
& "FundTypeA=" & TheFundTypeA & ", "_
& "FundTypeB=" & TheFundTypeB & ", "_
& "FundTypeC=" & TheFundTypeC & ", "_
& "FundTypeD=" & TheFundTypeD & ", "_
& "Sum=" & TheSum & ", "_
& "Summary='" & TheSummary & "', "_
& "Remark='" & TheRemark & "', "_
& "ModifyDate='" & TheModifyDate & "', "_
& "ProjectName='" & TheProjectName & "' " _
& " Where ID=" & Request.Form("UpdateID")
QueryLabel=3
TheMessage="記錄已經(jīng)修改成功"
end if
set RSThisRecord=conn.Execute("select * from FinancialRecord where ID="&Request.Form("UpdateID"))
else
TheMessage = "請(qǐng)?jiān)谙旅嫣顚懩薷牡呢?cái)務(wù)記錄的查詢條件"
QueryLabel=1
end if
set RSPersons = conn.Execute("select Name from UserInfo order by Name")
set RSFinancialRecord=conn.Execute("select * from FinancialRecord where AccountName='" _
& Session("Name") & "' order by Name")
set RSFinancialProject=conn.Execute("select * from FinancialProject order by FinancialProjectName")
%>
<HTML>
<HEAD>
<TITLE>公司財(cái)務(wù)信息管理系統(tǒng) </TITLE>
<META NAME="Generator" CONTENT="NetObjects Fusion 2.0.2 for Windows">
</HEAD>
<BODY BGCOLOR="">
<table width=800 border=0 bgcolor=#16A84D 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="#16A84D" 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=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3>
<font color=white>
<P ALIGN="CENTER">公司內(nèi)部辦公信息管理系統(tǒng)->公司財(cái)務(wù)信息管理系統(tǒng)->修改財(cái)務(wù)記錄 [當(dāng)前用戶-<% response.write Session("Name") %>]
</font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#10AD4D">返回內(nèi)網(wǎng)主頁</font></a></td>
<td align=center>
<% if Warning=false then %>
<font color="#10AD4D" ><% response.write TheMessage %></FONT>
<% else %>
<font color=Red ><% response.write TheMessage %></font>
<% end if %>
</td>
<td align=right><a href="Finance.asp"><font color="#10AD4D">返回上一級(jí)網(wǎng)頁</font></a></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td> </tr></table>
<br>
<FORM ACTION="ModifyFinancialRecord.asp" METHOD=POST>
<% if QueryLabel=1 then %>
<TABLE CELLPADDING=1 CELLSPACING=2 BORDER=1 bordercolor="#16A84D" WIDTH=800 align=center>
<TR VALIGN="center" ALIGN="center">
<TD WIDTH=20% bgcolor=#B5EFC7><img src="../image/finance1.jpg"></td>
<td>
<table CELLPADDING=1 CELLSPACING=1 BORDER=1 align=center width=100% bgcolor=White>
<tr height=35><td><input type=checkbox name=QueryCheck1 ></td><td ><font color="#16A84D">財(cái)務(wù)記錄ID</font></td><td><INPUT TYPE="text" NAME="FinancialRecordID" VALUE="" size=50> </td></tr>
<tr height=35><td><input type=checkbox name=QueryCheck2></td><td ><font color="#16A84D">財(cái)務(wù)項(xiàng)目名稱</font></td><td><INPUT TYPE="text" NAME="FinancialProjectName" VALUE="" size=50> </td></tr>
<tr height=35><td><input type=checkbox name=QueryCheck3 ></td><td width=25%><font color="#16A84D">財(cái)務(wù)記錄經(jīng)手人</font></td><td>
<SELECT NAME="SelectName" >
<%
Do Until RSPersons.EOF
%>
<OPTION VALUE="<% Response.Write RSPersons("Name") %>"><% Response.Write RSPersons("Name") %></OPTION>
<%
RSPersons.Movenext
loop
%>
</SELECT>
</td></tr>
<tr height=35><td><input type=checkbox name=QueryCheck4></td><td width=25%><font color="#16A84D">財(cái)務(wù)記錄添加日期</font></td><td>
<select name="AddYear" size=1>
<OPTION VALUE="<% Response.Write Year(Date) %>">  <% Response.Write Year(Date) %>  </OPTION>
<%
YearCounter = 2050
Do until YearCounter <=1990
%>
<OPTION VALUE="<% Response.Write YearCounter %>">  <% Response.Write YearCounter %>  </OPTION>
<%
YearCounter = YearCounter-1
loop
%>
</select>年
<select name="AddMonth" size=1>
<OPTION VALUE="<% Response.Write Month(Date) %>">  <% Response.Write Month(Date) %>  </OPTION>
<%
MonthCounter = 12
Do until MonthCounter <=0
%>
<OPTION VALUE="<% Response.Write MonthCounter %>">  <% Response.Write MonthCounter %>  </OPTION>
<%
MonthCounter = MonthCounter-1
loop
%>
</select>
月
<select name="AddDay" size=1>
<OPTION VALUE="<% Response.Write Day(Date) %>">  <% Response.Write Day(Date) %>  </OPTION>
<%
DayCounter = 31
Do until DayCounter <=0
%>
<OPTION VALUE="<% Response.Write DayCounter %>">  <% Response.Write DayCounter %>  </OPTION>
<%
DayCounter = DayCounter-1
loop
%>
</select>日
</td></tr></table>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=1 WIDTH=100% align=center>
<TR VALIGN="top" ALIGN="center">
<TD WIDTH=100% align=center >
<INPUT TYPE="submit" NAME="Query" VALUE="查詢符合條件的財(cái)務(wù)記錄" style="border: 1px solid #34BB66; background-color: #B6EBCA; color: #34BB66">
</TD></TR></table>
</td></TR></table>
<br>
<% end if %>
<% if QueryLabel=2 then %>
<table width=800 border=0 bgcolor=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr><td><font color=white>選中</font></td>
<td><font color=white>記錄ID</font></td>
<td><font color=white>記錄經(jīng)手人</font></td>
<td><font color=white>部門</font></td>
<td><font color=white>所屬財(cái)務(wù)項(xiàng)目</font></td>
<td><font color=white>款項(xiàng)A</font></td>
<td><font color=white>款項(xiàng)B</font></td>
<td><font color=white>款項(xiàng)C</font></td>
<td><font color=white>款項(xiàng)D</font></td>
<td><font color=white>合計(jì)</font></td>
<td><font color=white>添加日期</font></td>
<td><font color=white>最新修改日期</font></td></tr>
<%
Do until RSRecordResult.eof
response.write "<tr bgcolor=white><td><input type=radio name=RadioFinancialRecord value=" & RSRecordResult("ID") & "></td>"
response.write "<td>" & RSRecordResult("ID") & "</td>"
response.write "<td>" & RSRecordResult("Name") & "</td>"
response.write "<td>" & RSRecordResult("Department") & "</td>"
response.write "<td>" & RSRecordResult("ProjectName") & "</td>"
response.write "<td>" & RSRecordResult("FundTypeA") & "</td>"
response.write "<td>" & RSRecordResult("FundTypeB") & "</td>"
response.write "<td>" & RSRecordResult("FundTypeC") & "</td>"
response.write "<td>" & RSRecordResult("FundTypeD") & "</td>"
response.write "<td>" & RSRecordResult("Sum") & "</td>"
response.write "<td>" & RSRecordResult("AddDate") & "</td>"
response.write "<td>" & RSRecordResult("ModifyDate") & "</td></tr>"
RSRecordResult.Movenext
loop
%>
</table>
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td> </tr></table>
<p align=center>
<input type=submit name=SelectRecord value=  選中某條財(cái)務(wù)記錄   style="border: 1px solid #34BB66; background-color: #FFFFFF; color: #34BB66">
<% end if %>
<% if QueryLabel=3 then %>
<TABLE CELLPADDING=1 CELLSPACING=2 BORDER=1 bordercolor="#16A84D" WIDTH=800 align=center>
<TR VALIGN="center" ALIGN="center">
<TD WIDTH=20% bgcolor=#B5EFC7><img src="../image/finance1.jpg"></td>
<td>
<table CELLPADDING=1 CELLSPACING=1 BORDER=1 align=center width=100%>
<tr><td width=30%>財(cái)務(wù)記錄號(hào)</td><td>
<% response.write RSThisRecord("ID") %>
<input name=UpdateID type=hidden value="<% response.write RSThisRecord("ID") %>">
</td></tr>
<tr><td width=30%>財(cái)務(wù)記錄添加日期</td><td>
<% response.write RSThisRecord("AddDate") %>
</td></tr>
<tr><td width=30%>經(jīng)手人</td><td>
<Select name=UpdateName>
<option value="<% response.write RSThisRecord("Name") %>"><% response.write RSThisRecord("Name") %></option>
<%
Do until RSPersons.eof
response.write "<option value=" & RSPersons("Name") & ">"& RSPersons("Name") &"</option>"
RSPersons.movenext
loop
%>
</select>
</td></tr>
<tr><td width=30%>所屬財(cái)務(wù)項(xiàng)目</td><td>
<Select name=UpdateProjectName>
<option value="<% response.write RSThisRecord("ProjectName") %>"><% response.write RSThisRecord("ProjectName") %></option>
<%
Do until RSFinancialProject.eof
response.write "<option value=" & RSFinancialProject("FinancialProjectName") & ">"& RSFinancialProject("FinancialProjectName") &"</option>"
RSFinancialProject.movenext
loop
%>
</select>
</td></tr>
<tr><td width=30%>款項(xiàng)A</td><td><input name=UpdateFundTypeA value="<% response.write RSThisRecord("FundTypeA") %>">
</td></tr>
<tr><td width=30%>款項(xiàng)B</td><td><input name=UpdateFundTypeB value="<% response.write RSThisRecord("FundTypeB") %>">
</td></tr>
<tr><td width=30%>款項(xiàng)C</td><td><input name=UpdateFundTypeC value="<% response.write RSThisRecord("FundTypeC") %>">
</td></tr>
<tr><td width=30%>款項(xiàng)D</td><td><input name=UpdateFundTypeD value="<% response.write RSThisRecord("FundTypeD") %>">
</td></tr>
<tr><td width=30%>摘要</td><td><input name=UpdateSummary value="<% response.write RSThisRecord("Summary") %>">
</td></tr>
<tr><td width=30%>備注</td><td><input name=UpdateRemark value="<% response.write RSThisRecord("Remark") %>">
</td></tr>
</table>
<p align=center>
<input type=submit name=UpdateRecord value=  修改此條財(cái)務(wù)記錄   style="border: 1px solid #34BB66; background-color: #FFFFFF; color: #34BB66">
<% end if %>
<br>
</FORM>
</BODY>
</HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -