书城计算机网络综合应用软件设计
8724600000043

第43章 软件工程实例——构件库管理系统(7)

ddltool.Items.Add(rd(”toolname”))

Loop

rd.Close()

sql=”select producttypeid from tb_componentbasicinformation where(componentid=’”+compid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

id=rd.Item(”producttypeid”)

rd.Close()

sql=”select producttypename from tb_producttype where ( producttypeid=’”+id+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

ddlprodtype.Items.Add(rd(”producttypename”))

rd.Close()

sql=”Select producttypename From tb_producttype”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

Do While rd.Read

ddlprodtype.Items.Add(rd(”producttypename”))

Loop

rd.Close()

sql=”select componentfunctionid from tb_componentbasicinformation where(componentid=’”+compid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

id=rd.Item(”componentfunctionid”)

rd.Close()

sql=”select componentfunctionname from tb_componentfunction where(componentfunctionid=’”+id+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

ddlcompfunc.Items.Add(rd(”componentfunctionname”))

rd.Close()

sql=”Select componentfunctionname From tb_componentfunction”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

Do While rd.Read

ddlcompfunc.Items.Add(rd(”componentfunctionname”))

Loop

rd.Close()

sql=”select operationsystemid from tb_componentversioninformation where(versionid=’”+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

id=rd.Item(”operationsystemid”)

rd.Close()

sql=”select operationsystemname from tb_operationsystem where(operationsystemid=’”+id+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

ddlos.Items.Add(rd(”operationsystemname”))

rd.Close()

sql=”Select operationsystemname From tb_operationsystem”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

Do While rd.Read

ddlos.Items.Add(rd(”operationsystemname”))

Loop

rd.Close()

sql=”select componentcreator from tb_componentversioninformation where(versionid=’”+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

ddlcompauth.Items.Add(rd(”componentcreator”))

rd.Close()

sql=”Select authorname From tb_author”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

Do While rd.Read

ddlcompauth.Items.Add(rd(”authorname”))

Loop

rd.Close()

sql=”select componentintroduction from tb_componentbasicinformation where(componentid=’”+compid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

txtcompintro.Text=rd.Item(”componentintroduction”)

rd.Close()

sql=”select functionintroduction from tb_componentbasicinformation where(componentid=’”+compid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

txtfuncintro.Text=rd.Item(”functionintroduction”)

rd.Close()

sql=”select componentinstruction from tb_componentusageinformation where(versionid=’”+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

txtinstr.Text=rd.Item(”componentinstruction”)

rd.Close()

sql=”select componentexample from tb_componentusageinformation where(versionid=’”+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

txtexam.Text=rd.Item(”componentexample”)

rd.Close()

sql=”select componentpath from tb_componentusageinformation where(versionid=’”

+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

txtcomppath.Value=rd.Item(”componentpath”)

rd.Close()

sql=”select codefilepath from tb_componentusageinformation where(versionid=’”+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

txtcodefp.Value=rd.Item(”codefilepath”)

rd.Close()

sql=”select maintechnique from tb_componentversioninformation where(versionid=’”+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

txtmaintech.Text=rd.Item(”maintechnique”)

rd.Close()

sql=”select presupposition from tb_componentversioninformation where(versionid=’”+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

txtpre.Text=rd.Item(”presupposition”)

rd.Close()

sql=”select componentupdate from tb_componentversioninformation where(versionid=’”+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

txtcompupdate.Text=rd.Item(”componentupdate”)

rd.Close()

sql=”select componentversion from tb_componentversioninformation where(versionid=’”+versionid+”’)”

cmd=New SqlCommand(sql,conn)

rd=cmd.ExecuteReader

rd.Read()

id=rd.Item(”componentversion”)

rd.Close()

If id=”1.0”Then

txtcompupdate.ReadOnly=True

End If

conn.Close()

End If’在此处放置初始化页的用户代码

End Sub

Private Sub btnfinish_Click(ByVal sender As System.Object,ByVal e AsSystem.EventArgs)Handles btnfinish.Click

Dim mysql As String

Dim mycomd As SqlCommand

Dim myconn As SqlConnection

Dim myrd As SqlDataReader

Dim category As String

Dim tool As String

Dim product As String

Dim funct As String

Dim os As String

Dim versionid As String

myconn=New SqlConnection(”server=(local);database=componentsystem;Trusted_Connection=yes”)

myconn.Open()

versionid=Session(”versionid”)

mysql=”select componentcategoryid from tb_componentcategory where(categoryname=’”

+ddlcompcate.SelectedItem.Text+”’)”

mycomd=New SqlCommand(mysql,myconn)

myrd=mycomd.ExecuteReader

myrd.Read()

category=myrd.Item(”componentcategoryid”)

myrd.Close()

mysql=”select toolid from tb_tool where (toolname=’”+ddltool.SelectedItem.

Text+”’)”

mycomd=New SqlCommand(mysql,myconn)

myrd=mycomd.ExecuteReader

myrd.Read()

tool=myrd.Item(”toolid”)

myrd.Close()