mysql=”select producttypeid from tb_producttype where(producttypename=’”+ddlprodtype.SelectedItem.Text+”’)”
mycomd=New SqlCommand(mysql,myconn)
myrd=mycomd.ExecuteReader
myrd.Read()
product=myrd.Item(”producttypeid”)
myrd.Close()
mysql=”select componentfunctionid from tb_componentfunction where(componentfunctionname=’”+ddlcompfunc.SelectedItem.Text+”’)”
mycomd=New SqlCommand(mysql,myconn)
myrd=mycomd.ExecuteReader
myrd.Read()
funct=myrd.Item(”componentfunctionid”)
myrd.Close()
mysql=”select operationsystemid from tb_operationsystem where(operationsystemname=’”+ddlos.SelectedItem.Text+”’)”
mycomd=New SqlCommand(mysql,myconn)
myrd=mycomd.ExecuteReader
myrd.Read()
os=myrd.Item(”operationsystemid”)
myrd.Close()
mysql=”update tb_componentbasicinformation set componentintroduction=’”+txtcompintro.Text+”’,componentcategoryid=’”+category+”’,toolid=’”+tool+”’,producttypeid=’”+product+”’,componentfunctionid=’”+funct+”’,functionintroduction=’”+txtfuncintro.Text+”’where componentid=’”+lblcompid.Text+”’”
mycomd=New SqlCommand(mysql,myconn)
mycomd.ExecuteNonQuery()
mysql=”update tb_componentversioninformation set componentcreator=’”+ddlcompauth.SelectedItem.Text+”’,maintechnique=’”+txtmaintech.Text+”’,operationsystemid=’”+os+”’,presupposition=’”+txtpre.Text+”’,Componentupdate=’”+txtcompupdate.
Text+”’where versionid=’”+versionid+”’”
mycomd=New SqlCommand(mysql,myconn)
mycomd.ExecuteNonQuery()
m ysql=”update tb_componentusageinformation set componentinstruction=’”+txtinstr.
Text+”’,componentexample=’”+txtexam.Text+”’,componentpath=’”+txtcomppath.Value()+”’,codefilepath=’”+txtcodefp.Value()+”’where versionid=’”+versionid+”’”
mycomd=New SqlCommand(mysql,myconn)
mycomd.ExecuteNonQuery()
Response.Redirect(”success.aspx”)
myconn.Close()
End Sub
End Class
5.类信息添加修改页面
说明:以下代码为添加类信息页面的vb代码。修改类信息页面的vb代码与之相仿。
Imports System.Data
Imports System.Data.SqlClient
Public Class wfrmClassAdd
Inherits System.Web.UI.Page
Protected WithEvents lblSave As System.Web.UI.WebControls.Label
Protected WithEvents btnSave As System.Web.UI.WebControls.Button
Protected WithEvents RequiredFieldValidator1 As
System.Web.UI.WebControls. RequiredFieldValidator
Protected WithEvents txtClassDes As System.Web.UI.WebControls.TextBox
Protected WithEvents Label6 As System.Web.UI.WebControls.Label
Protected WithEvents lblError As System.Web.UI.WebControls.Label
Protected WithEvents RequiredFieldValidator2 As
System.Web.UI.WebControls. RequiredFieldValidator
Protected WithEvents txtClassName As System.Web.UI.WebControls.TextBox
Protected WithEvents Label4 As System.Web.UI.WebControls.Label
Protected WithEvents lblClassID As System.Web.UI.WebControls.Label
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
Protected WithEvents lblVersion As System.Web.UI.WebControls.Label
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents lblComName As System.Web.UI.WebControls.Label
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents hlkAttribute As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlkEvent As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlkMethod As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlkBase As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlkSuper As System.Web.UI.WebControls.HyperLink
Protected WithEvents Label5 As System.Web.UI.WebControls.Label
Protected WithEvents btnAdd As System.Web.UI.WebControls.Button
#Region”Web窗体设计器生成的代码”
’该调用是Web窗体设计器所必需的。
Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object,ByVal e As System.EventArgs)
Handles MyBase.Init
’CODEGEN:此方法调用是Web窗体设计器所必需的
’不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private ClassName As String
Private ComponentName As String
Private ComponentVersion As String
Private VersionID As String
Private Sub save(ByVal vID As String)
Dim myConn As New SqlConnection (”server=(local);database=componentSystem;Trusted_Connection=yes”)
myConn.Open()
Dim StrSQL As String
StrSQL=”Select ClassName From tb_ClassInformation Where VersionID=’”+vID+”’andClassName=’”+txtClassName.Text+”’”
Dim myCommand As SqlCommand=New SqlCommand(StrSQL,myConn)
Dim reader As SqlDataReader
reader=myCommand.ExecuteReader()
If reader.Read()Then
lblError.Text=”*该类已存在!”
reader.Close()
Exit Sub
Else
reader.Close()
StrSQL=”INSERT INTO tb_ClassInformation(ClassID,ClassName,ClassDeion,
VersionID)VALUES(’”+lblClassID.Text+”’,’”+txtClassName.Text+”’,’”+txtClassDes.Text+”’,”
+vID+”)”
myCommand=New SqlCommand(StrSQL,myConn)
myCommand.ExecuteNonQuery()
lblError.Text=””
lblError.Visible=True
lblSave.Text=”*注册成功!”
txtClassName.ReadOnly=True
txtClassDes.ReadOnly=True
btnAdd.Enabled=True
btnSave.Enabled=False
ChangeLink(lblClassID.Text)
End If
myConn.Close()
End Sub
Private Sub ChangeLink(ByVal classID As String)
hlkAttribute.NavigateUrl=”wfrmAttribute.aspx?ClassId=”+lblClassID.Text
hlkAttribute.Target=”_self”
hlkEvent.NavigateUrl=”wfrmEvent.aspx?ClassId=”+lblClassID.Text
hlkEvent.Target=”_sle”
hlkMethod.NavigateUrl=”wfrmMethod.aspx?ClassId=”+lblClassID.Text
hlkMethod.Target=”_self”
hlkBase.NavigateUrl=”wfrmBase.aspx?ClassId=”+lblClassID.Text
hlkBase.Target=”_slef”
hlkSuper.NavigateUrl=”wfrmSuper.aspx?ClassId=”+lblClassID.Text