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

📄 hqyjedit.aspx

📁 本系统属于现在最好的源码系统
💻 ASPX
字号:
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script Language="VB" runat="server">
  Dim HTLBSql as string
  Dim HTDJSql as string
  Dim strView as string  
  Dim HQHTNo as integer
  Dim Sql as string
  Dim myConn As OleDbConnection

  Function GetDataView(Sql As String,strTable As String) As DataView
    Dim myDataAdapter As OleDbDataAdapter 
    Dim myDataSet As DataSet
    myConn.Open()
    myDataAdapter = New OleDbDataAdapter (Sql , myConn) 
    myConn.close()
    myDataSet = New DataSet()
    MyDataAdapter.Fill(myDataSet,strTable)
    GetDataView = New DataView(myDataSet.Tables(strTable))
  End Function

  Function GetDataReader(Sql As String) As OleDbDataReader
    Dim myCmd As OleDbCommand
    myCmd = New OleDbCommand(Sql,myConn)
    myConn.Open()
    GetDataReader = myCmd.ExecuteReader()
  End Function

  Sub CloseConnection()
    myConn.Close()
  End sub
	
  Sub ExecuteSQL(Sql As String)
    Dim myCmd As OleDbCommand
    myCmd = New OleDbCommand(Sql,myConn)
    myConn.Open()
    myCmd.ExecuteNonQuery()
    myConn.Close()	  	       	    
  End sub

  Sub Page_Load(sender As Object, e As EventArgs)
    Dim strConn As String	
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" 
    strConn = strConn & server.MapPath(".") & "\HTGL.mdb"
    myConn = New OledbConnection(strConn)
  
    HQHTNo = Page.Request("id") 
  
    if not page.ispostback then
      Sql = "SELECT tblHQHT.HQHTID as HQHTID, tblHQHT.HQBH as HQBH, "
      Sql = Sql & "tblHQHT.SQRQ as SQRQ, tblHQHT.HQJG as HQJG, "
      Sql = Sql & "tblHQHT.HTLBID as HTLB, tblHQHT.HTDJID as HTDJ, "
      Sql = Sql & "tblHQHT.HTMC as HTMC, tblHQHT.HTBD as HTBD, "
      Sql = Sql & "tblHQHT.HTJE as HTJE, tblHQHT.HTYF as HTYF, "
      Sql = Sql & "tblHQHT.HTWB as HTWB, tblHQHT.JYNR as JYNR, "
      Sql = Sql & "tblHQHTYJ.HQYJ as HQYJ "
      Sql = Sql & "FROM tblHQHT, tblHQHTYJ "
      Sql = Sql & "WHERE (tblHQHT.HQHTID = " & HQHTNo & " AND "
      Sql = Sql & "tblHQHTYJ.HQHTID = " & tblHQHT.HQHTID & " AND "
      Sql = Sql & "tblHQHTYJ.HQBM = " & Session("UserDept") & " AND "
      Sql = Sql & "tblHQHTYJ.HQR = " & Session("UserID") & " ) "

      SubDisplay

    end if 
  End Sub

  Sub btOK_Click(sender As Object, e As EventArgs) 

    Sql = "SELECT * FROM tblHQHTYJ "
    Sql = Sql & "WHERE (tblHQHTYJ.HQHTID = " & HQHTNo & " AND "
    Sql = Sql & "tblHQHTYJ.HQBM = " & Session("UserDept") & " AND "
    Sql = Sql & "tblHQHTYJ.HQR = " & Session("UserID") & " ) "

    Dim okSql as String
    Dim Reader As OleDbDataReader = GetDataReader(Sql)
    Reader.Read()
    if IsDBNull(Reader.Item(0)) then
      okSql = "INSERT INTO tblHQHTYJ(HQHTID,HQBH,HQRQ,HQYJ,HQBM,HQR) VALUES( "
      okSql = okSql & HQHTNo & ",'" 
      okSql = okSql & tbHQBH.Text & "', '"
      okSql = okSql & DateTime.Today & "', '"
      okSql = okSql & HQYJ.Text & "', " 
      okSql = okSql & Session("UserDept") & " 
      okSql = okSql & Session("UserID") & ")"
    else
      okSql = "UPDATE tblHQHTYJ SET "
      okSql = okSql & "HQBH = '" & lblHQBH.Text & "', "
      okSql = okSql & "HQRQ = '" & lblHQRQ.Text & "', "
      okSql = okSql & "HQYJ = '" & tbHQYJ.Text & "', "
      okSql = okSql & "HQBM = '" & Session("UserDept") & "', "
      okSql = okSql & "HQR = '" & Session("UserID") & "', "
      okSql = okSql & "WHERE HQHTID = " & HQHTNo 
    end if
    ExecuteSQL(okSql)

    SubDisplay
  End Sub

  Sub btReturn_Click(sender As Object, e As EventArgs) 
    Dim urlNew as String
    urlNew = "HTHQ.aspx?id=" & HQHTNo
    Response.Redirect(urlNew)
    Response.Redirect("HTHQ.aspx")
  End Sub

  Sub SubDisplay()
    Dim Reader As OleDbDataReader = GetDataReader(Sql)
    Reader.Read()
    lblHQBH.text = Reader.Item(1)
    lblSQRQ.text = Reader.Item(2)
    lblHQJG.text = Reader.Item(3)

    HTLBSql = "SELECT tblHQHT.HTLBID, tblHQHT.HTLB FROM tblHTLB, tblHQHT WHERE tblHQHT.HTLBID = tblHTLB.HTLBID "
    Dim HTLBReader As OleDbDataReader = GetDataReader(HTLBSql)
    HTLBReader.Read()
    lblHTLB.Text=HTLBReader.Item(1)
    CloseConnection()

    HTDJSql = "SELECT tblHQHT.HTDJID, tblHQHT.HTDJ FROM tblHTDJ, tblHQHT WHERE tblHQHT.HTDJID = tblHTDJ.HTDJID "
    Dim HTDJReader As OleDbDataReader = GetDataReader(HTDJSql)
    HTDJReader.Read()
    lblHTDJ.Text=HTDJReader.Item(1)
    CloseConnection()

    lblHTMC.Text = Reader.Item(6)
    lblHTBD.Text = Reader.Item(7)
    lblHTJE.Text = Reader.Item(8)
    lblHTYF.Text = Reader.Item(9)

    lblHTWB.Text = Reader.Item(10)
    strView = Server.Mappath("Documents\") & lblHTWB.Text
    hlView.DataBind()

    lblJYNR.Text = Reader.Item(11)

    if IsDBNull(Reader.Item(12)) then
      lblHQYJ.Text = ''
    else
      lblHQYJ.Text = Reader.Item(12)
    end if

  End Sub

</script>

<html>
<head>
<title>合同会签</title>
</head>
<body>
<form runat="server">
  <table width="80%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#003333" bordercolordark="#FFFFFF">
    <tr>
      <td height="25" colspan="2" valign="top" bgcolor="#006699">
        <p align="center"><font color="#FFFF66">合同会签</font>
      </td>
    </tr>
    <tr>
      <td height="25" valign="top">
        会签编号:<asp:TextBox id="tbHQBH" runat="server" /><br>
	送签日期:<asp:TextBox id="tbSQRQ" runat="server" />
      </td>
    </tr>
    <tr>
      <td height="25" valign="top">
        合同类别:<asp:DropDownList id="dlHTLB" runat="server" />
      </td>
      <td height="25" valign="top">
        合同等级:<asp:DropDownList id="dlHTDJ" runat="server" />
      </td>
    </tr>
    <tr>
      <td height="25" colspan="2" valign="top">
        合同名称:<asp:TextBox id="tbHTMC" Columns="50" MaxLength="50" Text="" runat="server" />
      </td>
    </tr>
    <tr>
      <td height="25" colspan="2" valign="top">
        合同标的:<asp:TextBox id="tbHTBD" Columns="50" MaxLength="50" Text="" runat="server" />
      </td>
    </tr>
    <tr>
      <td height="25" colspan="2" valign="top">
        合同金额:<asp:TextBox id="tbHTJE" Columns="50" MaxLength="50" Text="" runat="server" />
      </td>
    </tr>
    <tr>
      <td height="25" colspan="2" valign="top">
        合同甲方:<asp:Label id="tbHTJF" Text="东风载重车公司销售部" runat="server" />
      </td>
    </tr>
    <tr>
      <td height="25" colspan="2" valign="top">
        合同乙方:<asp:TextBox id="tbHTYF" Columns="50" MaxLength="50" Text="" runat="server" />
      </td>
    </tr>
    <tr>
      <td height="25" colspan="3" valign="top">
        合同文本:<asp:label id="lblHTWB" runat="server" />&nbsp;&nbsp;
      	<asp:HyperLink id="hlView" navigateUrl='<%# strView %>' text="查看内容" target="_Blank" runat="server"/>
      </td>
    </tr>
    <tr>
      <td height="25" colspan="2" valign="top">
        简要内容:<br>
      	<asp:TextBox id="tbJYNR" TextMode="MultiLine" Columns="80" Rows="8" Text="" runat="server" />
      </td>
    </tr>
    <tr>
      <td height="25" colspan="2" valign="top">
        会签意见:<br>
      	<asp:TextBox id="tbHQYJ" TextMode="MultiLine" Columns="80" Rows="8" Text="" runat="server" />
      </td>
    </tr>
    <tr>
      <td height="25" colspan="2" align="center">
      	<asp:Button id="btOK" OnClick="btOK_Click" Text="保存" runat="server"/>
        <asp:Button id="btReturn" OnClick="btReturn_Click" Text="返回" runat="server"/>
      </td>
    </tr>
  </table>
</form>
</body>
</html>

⌨️ 快捷键说明

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