鉴于大家对JSP,NET,JAVA类别十分关注,我们编辑小组在此为大家搜集整理了“VB.NET电子商务网站”一文,供大家参考学习
客服咨询,网学网竭诚为您服务,本站永久域名:myeducs.cn |
第四章、系统程序实现 (一)系统主界面 在IE里运行本系统,出现系统的主界面,包括登陆信息、产品类别、产品信息显示列表、新闻信息列表模块。如图: 图4.1系统主界面 相关代码如下: Public strTslb As String = "" Public strTsxx As String = "" Dim tmpData As New DataControl Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then Dim tmpda As DataTable Dim i As Long tmpda = tmpData.Get_Table("select * from 产品类别") If tmpda.Rows.Count > 0 Then If tmpda.Rows.Count Mod 2 = 0 Then ''如果记录数%2等于0将产品类别循环拼合到字符串变量中 strTslb = "" For i = 0 To tmpda.Rows.Count / 2 - 1 strTslb = strTslb & "<tr>" Dim strTmpLx As String = "" strTmpLx = "<td class=''smallText''oncontextmenu=''return(false)'' onselectstart=''return false'' vAlign=''top'' noWrap align=''left'' width=''20%'' >" & "<img src=''/uploadfile/201305/11/9D15957311.jpg''> <a href=Index.aspx?lbid=" & tmpda.Rows(2 * i)("类别编号").ToString() + ">" & tmpda.Rows(2 * i)("类别名称").ToString() & "</a><br><br></td>" strTmpLx = strTmpLx + "<td class=''smallText''oncontextmenu=''return(false)'' onselectstart=''return false'' vAlign=''top'' noWrap align=''left'' width=''20%'' >" & "<img src=''/uploadfile/201305/11/9D15957311.jpg''><a href=Index.aspx?lbid=" & tmpda.Rows(2 * i + 1)("类别编号").ToString() & ">" & tmpda.Rows(2 * i + 1)("类别名称").ToString() & "</a><br><br></td>" strTslb = strTslb & strTmpLx & "</tr>" Next Else strTslb = "" ''否则 循环显示全部记录-1 在后面补足最后一条记录 For i = 0 To Fix(tmpda.Rows.Count / 2) - 1 strTslb = strTslb + "<tr>" Dim strTmpLx As String = "" strTmpLx = "<td class=''smallText''oncontextmenu=''return(false)'' onselectstart=''return false'' vAlign=''top'' noWrap align=''left'' width=''20%'' >" & "<img src=''/uploadfile/201305/11/9D15957311.jpg''> <a href=Index.aspx?lbid=" & tmpda.Rows(2 * i)("类别编号").ToString() + ">" & tmpda.Rows(2 * i)("类别名称").ToString() & "</a><br><br></td>" strTmpLx = strTmpLx + "<td class=''smallText''oncontextmenu=''return(false)'' onselectstart=''return false'' vAlign=''top'' noWrap align=''left'' width=''20%'' >" & "<img src=''/uploadfile/201305/11/9D15957311.jpg''><a href=Index.aspx?lbid=" & tmpda.Rows(2 * i + 1)("类别编号").ToString() & ">" & tmpda.Rows(2 * i + 1)("类别名称").ToString() & "</a><br><br></td>" strTslb = strTslb & strTmpLx & "</tr>" Next ''拼接最后一条记录 Dim strTmpLx1 As String = "" strTslb = strTslb + "<tr>" strTmpLx1 = "<td class=''smallText''oncontextmenu=''return(false)'' onselectstart=''return false'' vAlign=''top'' noWrap align=''left'' width=''20%'' >" & "<img src=''/uploadfile/201305/11/9D15957311.jpg''> <a href=Index.aspx?lbid=" & tmpda.Rows(tmpda.Rows.Count - 1)("类别编号").ToString() & ">" & tmpda.Rows(tmpda.Rows.Count - 1)("类别名称").ToString() & "</a><br><br></td>" strTslb = strTslb & strTmpLx1 & "</tr>" End If End If Dim DPath As String DPath = "Admin\Pic\" If Request.QueryString("lbid") = "" Then ''显示全部的产品信息 strTsxx = DataControl.initItemList(tmpData.Get_Table("select * from 产品信息"), DPath, "CpxxSee.aspx") Else ''显示指定类型的产品信息 strTsxx = DataControl.initItemList(tmpData.Get_Table("select * from 产品信息 where 类别编号=" + Request.QueryString("lbid").ToString()), DPath, "CpxxSee.aspx") End If If Request.QueryString("str") <> "" Then ''显示指定类型的产品信息 strTsxx = DataControl.initItemList(tmpData.Get_Table("select * from 产品信息 where " + Request.QueryString("str").ToString()), DPath, "CpxxSee.aspx") End If End If End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ''判断登陆人员的密码和用户是不是正确 If TextBox1.Text.Trim() = "admin" Then Dim tmpda As New DataTable() tmpda = tmpData.Get_Table("select * from 管理员 where 帐号=''" & TextBox1.Text.Trim() & "'' and 密码=''" & TextBox2.Text.Trim() & "''") If (tmpda.Rows.Count <= 0) Then Response.Write("<script>alert(''用户或密码错误'');window.location.href=''index.aspx'';</script>") Exit Sub End If Else Dim tmpda As New DataTable() tmpda = tmpData.Get_Table("select * from 会员信息 where 会员帐号=''" & TextBox1.Text.Trim() & "'' and 密码=''" & TextBox2.Text.Trim() & "''") If (tmpda.Rows.Count <= 0) Then Response.Write("<script>alert(''用户或密码错误'');window.location.href=''index.aspx'';</script>") Exit Sub End If End If ''保存用户名到公用Session Session("UserID") = TextBox1.Text.Trim() Response.Redirect("index0.aspx") End Sub Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click ''跳转页面 Response.Redirect("UserReg.aspx") End Sub Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click ''跳转页面 Response.Redirect("about.aspx") End Sub Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click ''传递条件 跳转页面 Dim strFind As String = " 产品名称 like ''%" + TextBox3.Text + "%'' " Response.Redirect("index.aspx?str=" + strFind + "") End Sub (二)基本功能模块 后台: 1.GoodList(产品信息维护) 此模块主要是对产品信息的维护。添加产品信息时,判断产品名称是否为空。添加修改产品信息时,关联产品类别。删除产品信息时,关联定单明细表。 |
本站发布的计算机毕业设计均是完整无错的全套作品,包含开题报告+程序+论文+源代码+翻译+答辩稿PPT |
本文选自计算机毕业设计http://myeducs.cn |