订单信息窗体:
当然就是一个datagrid控件了,他的“明细”按钮打开的是后台时设计的那个页面——saleinfo.aspx
Dim myconstr As String = ConfigurationSettings.AppSettings("constr") & Server.MapPath(".") & ConfigurationSettings.AppSettings("dbs")
Dim mycon As OleDb.OleDbConnection = New OleDb.OleDbConnection(myconstr)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Bindgrid()
End If
End Sub
'为datalist绑定数据的过程,最新上架
Sub Bindgrid()
Dim uid As Integer
uid = Request.Cookies("uid").Value
Dim mysql As String
mysql = "SELECT * FROM tab_salelist where uid=" & uid
Dim mycmd As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(mysql, mycon)
Dim dt As Data.DataSet = New Data.DataSet
mycmd.Fill(dt)
Dim dv As Data.DataView = New Data.DataView(dt.Tables(0))
DataGrid1.DataSource = dv
DataGrid1.DataBind()
End Sub
Private Sub DataGrid1_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand
Dim id As String
id = e.Item.Cells(0).Text
Response.Write("<script language='javascript'>open('saleinfo.aspx?id=" & id & "','编辑','width=600,height=400,left=150,top=150,resizable=0,scrollbars=0,status=no,toolbar=no,location=no,menu=no')</" & "script>")
End Sub
【搜索】
搜索的界面和主页十分相似,用的控件也基本一样,一个列表种类,用的是datalist,另一个用于显示明细,仍然用datalist。种类列表的点击事件去改变显示列表的数据源。这个和access里是一样的。
[此贴子已经被作者于2006-8-20 0:45:29编辑过]
|