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

📄 invoiceedit.asp

📁 财务管理系统 报账等基本功能实现 有完整的实现
💻 ASP
字号:
<!--#include file="../conndb.asp"-->
<html>
<head>
<title>编辑发票信息</title>
<link rel="stylesheet" href="../style.css">
<Script Language="JavaScript">
//域校验
function CheckFlds(){
  if (document.form1.invid.value==""){
   alert("请输入发票编号!");
   form1.invid.focus;
   return false;
  } 
  if (document.form1.custid.selectedIndex<0){
   alert("请选择客户名称!");
   form1.custid.focus;
   return false;
  } 
  if (document.form1.type.selectedIndex<0){
   alert("请选择发票类型!");
   form1.type.focus;
   return false;
  }  
  if (document.form1.isum.value==""){
   alert("请输入发票金额!");
   form1.isum.focus;
   return false;
  } 
  if (document.form1.idate.value==""){
   alert("请输入发票日期!");
   form1.idate.focus;
   return false;
  } 
  return true;
}
</Script>
</head>
<%
  Dim TypeId,InvId,CustId,InvSum,InvDate,Memo,Title
  Dim Action,rs
  '变量初始化
  InvId = ""
  InvSum = 0
  InvDate = Date()
  '读取参数action\iid
  Action = Request.QueryString("action")
  InvId = Request.QueryString("iid") 
  Set rs = Server.CreateObject("ADODB.RecordSet")
  '编辑问题记录
  If Action = "edit" Then
    '设置SELECT语句,读取记录数据
    sql = "SELECT * FROM Invoice WHERE InvId=" & InvId
    rs.Open sql,conn,1,3
    If Not rs.EOF Then
      CustId = rs("CustId")
      TypeId = rs("TypeId")
      Title = rs("Title")
      InvSum = rs("InvSum")
      InvDate = rs("InvDate")
      Memo = rs("Memo")
   End If
   rs.Close()
  End If
%>
<body leftmargin="1" topmargin="0">
<form name="form1" method="POST" action="InvoiceSave.asp?action=<%=Action%>&iid=<%=InvId%>" onsubmit="return CheckFlds()">
<br>
 <table align="center" border="1" cellspacing="0" width="95%" bordercolor="#64B9E1" bordercolorlight="#64B9E1" bordercolordark="#FFFFFF">
    <tr>
      <td bgcolor="#FFFFFF" colspan="4" width="100%" background="pic/invoice.jpg" height="90">
      <p align="center"><b><font face="华文彩云" color="#000080" size="6">发票信息</font></b></p>
      </td>
    </tr>
     <tr>
      <td bgcolor="#CEE7FF">发票编号</td>
      <td colspan="3"><input type="text" name="invid" size="20" value="<%=InvId%>" <%If Action = "edit" Then%>ReadOnly<%End If%>>&nbsp;</td>
    </tr>
   <tr>
      <td width="25%" bgcolor="#CEE7FF">选择客户名称</td>
      <td width="25%"><select size="1" name="custid">
      <%
        sql = "Select * From Customer ORDER BY CustId" 
        rs.Open sql,conn,1,3
        Do While Not rs.EOF
          If rs("CustId")=CustId Then         
        %>
          <option selected value="<%=rs("CustId")%>"><%=rs("CustName")%></option>
          <%Else%>
          <option value="<%=rs("CustId")%>"><%=rs("CustName")%></option>
          <%End If
          rs.MoveNext()
        Loop
        rs.Close()%>
         </select></td>
      <td width="25%" bgcolor="#CEE7FF">发票类型</td>
      <td width="25%"><select size="1" name="type">
      <%sql = "Select * From Types Where Flag=8 ORDER BY TypeId" 
        rs.Open sql,conn,1,1
        Do While Not rs.EOF
          If rs("TypeId")=TypeId Then         
        %>
          <option selected value="<%=rs("TypeId")%>"><%=rs("TypeName")%></option>
          <%Else%>
          <option value="<%=rs("TypeId")%>"><%=rs("TypeName")%></option>
          <%End If
          rs.MoveNext()
        Loop
        rs.Close()%>
         </select></td>
    </tr>
    <tr>
      <td bgcolor="#CEE7FF">发票抬头</td>
      <td colspan="3"><input type="text" name="title" size="16" value="<%=Title%>">&nbsp;</td>
    </tr>
    <tr>
      <td bgcolor="#CEE7FF">发票金额</td>
      <td><input type="text" name="isum" size="16" value="<%=InvSum%>">&nbsp;</td>
      <td bgcolor="#CEE7FF">开票日期</td>
      <td><input type="text" name="idate" size="16" value="<%=InvDate%>">&nbsp;</td>
    </tr>
    <tr>
      <td bgcolor="#CEE7FF">备注</td>
      <td colspan="3"><textarea rows="4" name="memo" cols="50"><%=Memo%></textarea>&nbsp;</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 + -