VB.NET企业网上订货系统(9)

来源:xiaoniu168.com 作者:本站原创 添加时间:2011-11-26 点击数:28314

计算机毕业设计后台功能介绍:

后台:
1.GoodList(产品信息维护)
此模块主要是对产品信息的维护。添加产品信息时,判断产品名称是否为空。添加修改产品信息时,关联产品类别。删除产品信息时,关联定单明细表。如图:

计算机毕业论文

以下是引用片段:

其相关代码如下:
Dim tmpData As New DataControl

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        Dim key As String = GridView1.DataKeys(Convert.ToInt32(e.CommandArgument)).Value.ToString()
        If e.CommandName = "Mod" Then
            '跳转页面
            Response.Goods.aspx?ID=" & key)
        ElseIf e.CommandName = "Del" Then
            '判断此信息是否使用.使用不能删除
            If tmpData.Get_Table("select * from 购物车 where 产品编号=" + key + "").Rows.Count > 0 Then
                Terr.当前产品信息正在使用>"
                Exit Sub
            End If
            If tmpData.Get_Table("select * from 订单内容 where 产品编号=" + key + "").Rows.Count > 0 Then
                Terr.当前产品信息正在使用"
                Exit Sub
            End If
            Dim DPath As String
            If Server.MapPath("").Substring(Server.MapPath("").Length - 1, 1) = "\" Then
                DPath = Server.MapPath("")
            Else
                DPath = Server.MapPath("") + "\"
            End If
            DPath = DPath + "Pic\"
            Dim PicName As String = tmpData.Get_Table("select 图片文件名 from 产品信息 where  产品编号=" + key + "").Rows(0)(0).ToString()
            '/删除关联的图片文件
            If File.Exists(DPath & PicName) Then File.Delete(DPath & PicName)
            '删除产品信息
            tmpData.ExecSql("delete from 产品信息 where 产品编号=" + key + "")
            GridView1.DataSource = tmpData.Get_Table("select * from 产品信息,产品类别 where 产品信息.类别编号=产品类别.类别编号")
            GridView1.DataBind()
        End If
    End Sub

〖资料来源:计算机毕业论文 www.xiaoniu168.com

第10页为计算机毕业论文订单信息功能介绍......

下一篇:VB.NET博客系统

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网