mydata.vb

=============mydata.vb
Imports System.Data
Imports System.Data.OleDb
Imports System.Text
Imports System.Web.HttpRequest

Public Class mydata

    '***********************************************************
    '招聘的增加
    '***********************************************************
    Public Shared Sub job_add(ByVal rootid As Integer, ByVal layer As Integer, ByVal title As String, ByVal body As String, ByVal needno As Integer, ByVal other As String, ByVal ip As String)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mycommand As New OleDbCommand("insert into job(rootid,layer,title,body,needno,other,updatetime,ip) values(@rootid,@layer,@title,@body,@needno,@other,@updatetime,@ip)", myconnection)
        mycommand.Parameters.Add("@rootid", rootid)
        mycommand.Parameters.Add("@layer", layer)
        mycommand.Parameters.Add("@titler", title)
        mycommand.Parameters.Add("@body", body)
        mycommand.Parameters.Add("@needno", needno)
        mycommand.Parameters.Add("@other", other)
        mycommand.Parameters.Add("@updatetime", DateTime.Now)
        mycommand.Parameters.Add("@ip", ip)
        mycommand.ExecuteNonQuery()
        myconnection.Close()
    End Sub
    '***********************************************************
    '会员的增加
    '***********************************************************
    Public Shared Sub members_add _
    (ByVal rootid As Integer, ByVal username As String, ByVal password As String, ByVal email As String, ByVal sex As String, ByVal zip As String, ByVal tel As String, ByVal incorp As String, ByVal work As String, ByVal ip As String)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mycommand As New OleDbCommand("insert into members([rootid],[username],[password],[email],[sex],[zip],[tel],[incorp],[work],[ip],[updatetime]) values(@rootid,@username,@password,@email,@sex,@zip,@tel,@incorp,@work,@ip,@updatetime)", myconnection)
        '基本的
        mycommand.Parameters.Add("@rootid", rootid)
        mycommand.Parameters.Add("@username", username)
        mycommand.Parameters.Add("@password", System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password, "md5"))
        mycommand.Parameters.Add("@email", email)
        mycommand.Parameters.Add("@sex", sex)
        mycommand.Parameters.Add("@zip", zip)
        mycommand.Parameters.Add("@tel", tel)
        mycommand.Parameters.Add("@incorp", incorp)
        mycommand.Parameters.Add("@work", work)
        mycommand.Parameters.Add("@ip", ip)
        '时间
        mycommand.Parameters.Add("@UPDATETIME", DateTime.Now)
        mycommand.ExecuteNonQuery()
        myconnection.Close()
    End Sub
    '***********************************************************
    '供货商的增加
    '***********************************************************
    Public Shared Sub members_add_2 _
    (ByVal rootid As Integer, ByVal username As String, ByVal password As String, ByVal email As String, ByVal sex As String, ByVal zip As String, ByVal tel As String, ByVal incorp As String, ByVal work As String, ByVal ip As String, _
    ByVal corpbrief As String, ByVal corpname As String, ByVal corpaddr As String, ByVal corpshape As String, ByVal corpscale As String, ByVal corpson As String, ByVal person As String, ByVal fax As String, ByVal legalpower As Integer)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mycommand As New OleDbCommand( _
"insert into members([rootid],[username],[password],[email],[sex],[zip],[tel],[incorp],[work],[ip],[updatetime],[corpbrief],[corpname],[corpaddr],[corpshape],[corpscale],[corpson],[person],[fax],[LEGALPOWER])  values(@rootid,@username,@password,@email,@sex,@zip,@tel,@incorp,@work,@ip,@updatetime,@corpbrief,@corpname,@corpaddr,@corpshape,@corpscale,@corpson,@person,@fax,@LEGALPOWER)", _
myconnection)
        '基本的
        mycommand.Parameters.Add("@rootid", rootid)
        mycommand.Parameters.Add("@username", username)
        mycommand.Parameters.Add("@password", System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password, "md5"))
        mycommand.Parameters.Add("@email", email)
        mycommand.Parameters.Add("@sex", sex)
        mycommand.Parameters.Add("@zip", zip)
        mycommand.Parameters.Add("@tel", tel)
        mycommand.Parameters.Add("@incorp", incorp)
        mycommand.Parameters.Add("@work", work)
        mycommand.Parameters.Add("@ip", ip)
        '时间
        mycommand.Parameters.Add("@UPDATETIME", DateTime.Now)
        '基本的
        mycommand.Parameters.Add("@corpbrief", corpbrief)
        mycommand.Parameters.Add("@corpname", corpname)
        mycommand.Parameters.Add("@corpaddr", corpaddr)
        mycommand.Parameters.Add("@corpshape", corpshape)
        mycommand.Parameters.Add("@corpscale", corpscale)
        mycommand.Parameters.Add("@corpson", corpson)
        mycommand.Parameters.Add("@person", person)
        mycommand.Parameters.Add("@fax", fax)
        '权限
        mycommand.Parameters.Add("@LEGALPOWER", legalpower)
        mycommand.ExecuteNonQuery()
        myconnection.Close()
    End Sub
    '***********************************************************
    '产品的增加
    '可供 供货商提交数据
    '***********************************************************
    Public Shared Sub product_add _
    (ByVal boardid As Integer, ByVal product_name As String, ByVal product_SHAPE As String, ByVal product_Specification As String, ByVal product_memory As String, ByVal product_money As Integer, ByVal addr As String, ByVal smallpic As String, ByVal pic As String, ByVal layer As Integer, ByVal sender As String, ByVal other As String, ByVal rootid As Integer, ByVal rootid2 As Integer, ByVal shape As String)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mycommand As New OleDbCommand( _
"insert into product([boardid],[product_name],[product_SHAPE],[product_Specification],[product_memory],[product_money],[addr],[smallpic],[pic],[layer],[sender],[updatetime],[other],[rootid],[rootid2],[shape])  values(@boardid,@product_name,@product_SHAPE,@product_Specification,@product_memory,@product_money,@addr,@smallpic,@pic,@layer,@sender,@updatetime,@other,@rootid,@rootid2,@shape)", _
myconnection)
        '基本的
        mycommand.Parameters.Add("@boardid", boardid)
        mycommand.Parameters.Add("@product_name", product_name)
        mycommand.Parameters.Add("@product_SHAPE", product_SHAPE)
        mycommand.Parameters.Add("@product_Specification", product_Specification)
        mycommand.Parameters.Add("@product_memory", product_memory)
        mycommand.Parameters.Add("@product_money", product_money)
        mycommand.Parameters.Add("@addr", addr)
        mycommand.Parameters.Add("@smallpic", smallpic)
        mycommand.Parameters.Add("@pic", pic)
        mycommand.Parameters.Add("@layer", layer)
        mycommand.Parameters.Add("@sender", sender)
        '系统的
        mycommand.Parameters.Add("@updatetime", Date.Now.ToString)
        '基本的
        mycommand.Parameters.Add("@other", other)
        mycommand.Parameters.Add("@rootid", rootid)
        mycommand.Parameters.Add("@rootid2", rootid2)
        mycommand.Parameters.Add("@shape", shape)

        mycommand.ExecuteNonQuery()  '插入记录

        'Dim mysql2 As String
        'mysql2 = "update product set [rootid]=(select max(rootid) from product)+10 where [id]=max(id)"
        'Dim mycommand2 As New OleDbCommand(mysql2, myconnection)
        'mycommand2.ExecuteNonQuery() '更新记录

        myconnection.Close()
    End Sub
    '***********************************************************
    '产品的增加
    '***********************************************************
    Public Shared Sub product_add2 _
    (ByVal product_name As String, ByVal product_SHAPE As String, ByVal product_Specification As String, ByVal product_memory As String, ByVal pic As String)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mycommand As New OleDbCommand( _
"insert into product([product_name],[product_SHAPE],[product_Specification],[product_memory],[pic])  values(@product_name,@product_SHAPE,@product_Specification,@product_memory,@pic)", _
myconnection)
        '基本的
        mycommand.Parameters.Add("@product_name", product_name)
        mycommand.Parameters.Add("@product_SHAPE", product_SHAPE)
        mycommand.Parameters.Add("@product_Specification", product_Specification)
        mycommand.Parameters.Add("@product_memory", product_memory)
        mycommand.Parameters.Add("@pic", pic)

        mycommand.ExecuteNonQuery()
        myconnection.Close()
    End Sub
    '***********************************************************
    '产品的修改
    '可供 供货商提交数据
    '***********************************************************
    Public Shared Sub product_update _
    (ByVal rootid As Integer, ByVal rootid2 As Integer, ByVal shape As String, ByVal myid As String, ByVal boardid As Integer, ByVal product_name As String, ByVal product_SHAPE As String, ByVal product_Specification As String, ByVal product_memory As String, ByVal product_money As Integer, ByVal addr As String, ByVal smallpic As String, ByVal pic As String, ByVal other As String)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mysql As String = "update product set [rootid]=@rootid,[rootid2]=@rootid2,[shape]=@shape,[boardid]=@boardid,[product_name]=@product_name,[product_shape]=@product_shape,[product_Specification]=@roduct_Specification,[product_memory]=@product_memory,[product_money]=@product_money,[addr]=@addr,[smallpic]=@smallpic,[pic]=@pic,[other]=@other,[sender]=@sender,[updatetime]=@updatetime  where [id]="
        mysql += myid
        Dim mycommand As New OleDbCommand(mysql, myconnection)
        '基本的
        mycommand.Parameters.Add("@rootid", rootid)
        mycommand.Parameters.Add("@rootid2", rootid2)
        mycommand.Parameters.Add("@shape", shape)
        mycommand.Parameters.Add("@boardid", boardid)
        mycommand.Parameters.Add("@product_name", product_name)
        mycommand.Parameters.Add("@product_SHAPE", product_SHAPE)
        mycommand.Parameters.Add("@product_Specification", product_Specification)
        mycommand.Parameters.Add("@product_memory", product_memory)
        mycommand.Parameters.Add("@product_money", product_money)
        mycommand.Parameters.Add("@addr", addr)
        mycommand.Parameters.Add("@smallpic", smallpic)
        mycommand.Parameters.Add("@pic", pic)
        ' mycommand.Parameters.Add("@layer", layer)
        mycommand.Parameters.Add("@other", other)

        '系统的
        mycommand.Parameters.Add("@sender", System.Web.HttpContext.Current.Session("username"))
        mycommand.Parameters.Add("@updatetime", Date.Now.ToString)

        mycommand.ExecuteNonQuery()
        myconnection.Close()
    End Sub
    Public Shared Sub product_update_test(ByVal myid As String, ByVal product_name As String)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mysql As String = "update product set product_name=@product_name where [id]="
        mysql += myid
        Dim mycommand As New OleDbCommand(mysql, myconnection)
        mycommand.Parameters.Add("@product_name", product_name)
        mycommand.ExecuteNonQuery()
        myconnection.Close()
    End Sub
    Public Shared Sub subjects_update(ByVal id As String, ByVal rootid As Integer, ByVal subject As String)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mysql As String = "update subjects set rootid=@rootid,subject=@subject where [id]=" & id
        Dim mycommand As New OleDbCommand(mysql, myconnection)
        mycommand.Parameters.Add("@rootid", rootid)
        mycommand.Parameters.Add("@subject", subject)
        mycommand.ExecuteNonQuery()
        myconnection.Close()
    End Sub
    'note: id 暂时没有用到,目的是与 subjects_update兼容
    Public Shared Sub subjects_Add(ByVal id As String, ByVal rootid As Integer, ByVal subject As String)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mysql As String = "insert into subjects([rootid],[parentcolumn],[subject])  values(@rootid,@parentcolumn,@subject)"
        Dim mycommand As New OleDbCommand(mysql, myconnection)
        mycommand.Parameters.Add("@rootid", rootid)
        mycommand.Parameters.Add("@parentcolumn", "产品发布")
        mycommand.Parameters.Add("@subject", subject)
        mycommand.ExecuteNonQuery()
        myconnection.Close()
    End Sub

    '***********************************************************
    '投票
    '可供 提交数据
    '***********************************************************
    Public Shared Sub mycount_Add(ByVal result As String)
        Dim myconnection As New OleDbConnection(CommunityGlobals.ConnectionString)
        myconnection.Open()
        Dim mysql As String = "insert into mycount([result],[updatetime],[ip])  values(@result,@updatetime,@ip)"
        Dim mycommand As New OleDbCommand(mysql, myconnection)
        mycommand.Parameters.Add("@result", result)
        mycommand.Parameters.Add("@updatetime", Now())
        mycommand.Parameters.Add("@ip", System.Web.HttpContext.Current.Request.ServerVariables("LOCAL_ADDR"))
        mycommand.ExecuteNonQuery()
        myconnection.Close()
    End Sub
End Class

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值