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

📄 itemedit.asp

📁 财务管理系统 报账等基本功能实现 有完整的实现
💻 ASP
字号:
<!--#include file="../../conndb.asp"-->
<html>
<head>
<title>编辑工资项目</title>
<link rel="stylesheet" href="../../style.css">
<Script Language="JavaScript">
//域校验
function CheckFlds(){
  if (document.form1.itemname.value==""){
   alert("请输入项目名称!");
   form1.itemname.focus;
   return false;
 } 
return true;
}
//更改项目类型:如果为固定值,则计算器按钮不可用;
//如果为计算值,则项目金额编辑框不可用
function ChangeSel(){
  var tindex;
  tindex = document.form1.type.selectedIndex;
  if(tindex==0){
    document.form1.itemsum.disabled = false;
    document.form1.BFor.disabled = true;
  }
  else{
    document.form1.itemsum.disabled = true;
    document.form1.BFor.disabled = false;
  }
}
</Script>
</head>
<%
  Dim ItemName,ItemType,ItemSum,Formula,iVis,Oper,StrType,StrOper,StrVis
  Dim Action
  '变量初始化
  Action = "add"
  ItemName = ""
  ItemType = 1
  ItemSum = 0
  Formula = ""
  iVis = 1
  Oper = 0 
  StrType = ""
  StrOper = ""
  StrVis = ""
  Dim ItemId
  '读取参数action
  Action = Request.QueryString("action")
  ItemId = Request.QueryString("iid")  
  '编辑工资项目记录
  If Action = "edit" Then
    '设置SELECT语句,读取记录数据
    sql = "Select * From SalaryItem Where ItemId=" & ItemId
    Set rs = Conn.Execute(sql)
    If Not rs.EOF Then
      ItemName = rs("ItemName")
      ItemType = rs("ItemType")
      ItemSum = rs("ItemSum")
      Formula = rs("Formula")
      iVis = rs("isVisible")
      Oper = rs("Operation")
      If rs("ItemType")=0 Then
        StrType = "系统值"
      ElseIf rs("ItemType")=1 Then
        StrType = "固定值"
      Else
        StrType = "计算值"
      End If
      If rs("isVisible")=1 Then
        StrVisible = "是"
      Else
        StrVisible = "否"
      End If
      If rs("Operation")=0 Then
        StrOper = "税前加"
      ElseIf rs("Operation")=1 Then
        StrOper = "税前减"
      ElseIf rs("Operation")=2 Then
        StrOper = "税后加"
      Else
        StrOper = "税后减"
      End If
   End If
  End If
%>
<body leftmargin="1" topmargin="0">
<form name="form1" method="POST" action="ItemSave.asp?action=<%=Action%>&iid=<%=ItemId%>" onsubmit="return CheckFlds()">
<br>
 <table align="center" border="1" cellspacing="0" width="96%" bordercolor="#64B9E1" bordercolorlight="#64B9E1" bordercolordark="#FFFFFF">
    <tr>
      <td bgcolor="#FFFFFF" colspan="4" background="../pic/item.jpg" height="90">
      <p align="center"><b><font face="华文彩云" color="#000080" size="6">工资项目信息</font></b></p>
      </td>
    </tr>
    <tr>
      <td width="30%" bgcolor="#CEE7FF">工资项目名称</td>
      <td width="70%"><input type="text" name="itemname" size="20" value="<%=ItemName%>">&nbsp;</td>
    </tr>
    <tr>
      <td bgcolor="#CEE7FF">项目类型</td>
      <td><select size="1" name="type" onChange="ChangeSel()">
        <%If ItemType=1 Then%>
          <option value="1" selected>固定值</option>
          <option value="2">计算值</option>
        <%Else%>
          <option value="1">固定值</option>
          <option value="2" selected>计算值</option>
        <%End If%>
         </select></td>
   </tr>
    <tr>
      <td bgcolor="#CEE7FF">项目金额</td>
      <td><input type="text" name="itemsum" size="20" value="<%=ItemSum%>">&nbsp;</td>
    </tr>
    <tr>
      <td bgcolor="#CEE7FF">计算公式</td>
      <td><input type="text" name="formula" size="20" value="<%=Formula%>" ReadOnly>&nbsp;
      <input type="button" value="公式计算器" onclick="javascript:news=window.open('calculator.asp','news','x=100,y=100,height=180,width=330,status=no,toolbar=no,menubar=no,scrollbars=no,location=no,resizable=no');news.focus();" name="BFor" style="font-family: 宋体; font-size: 9pt"></font>
      </td>
    </tr>
    <tr>
      <td bgcolor="#CEE7FF">是否显示</td>
      <td><select size="1" name="isvis">
         <%If iVis=0 Then%>
         <option value="0" selected>不显示</option>
          <option value="1">显示</option>
        <%Else%>
         <option value="0">不显示</option>
          <option value="1" selected>显示</option>
        <%End If%>
        </select></td>
    </tr>
    <tr>
       <td bgcolor="#CEE7FF">运算方式</td>
      <td><select size="1" name="oper">
          <option <%If Oper=0 Then%>selected<%End If%> value="0">税前加</option>
          <option <%If Oper=1 Then%>selected<%End If%> value="1">税前减</option>
          <option <%If Oper=2 Then%>selected<%End If%> value="2">税后加</option>
          <option <%If Oper=3 Then%>selected<%End If%> value="3">税后减</option>
         </select></td>
    </tr>
 </table>
  <p align=center><input type="submit" value=" 提 交 " name="B1">
  <input type="reset" value=" 重 写 " name="B2"></p>
</form>
</body>
</html>

⌨️ 快捷键说明

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