📄 client.vb
字号:
Imports System.Data.SqlClient
Public Class Client
'显示供应商和购货商信息
'根据存储过程,利用users.showInfo实现
'添加供应商和购货商信息
Public Shared Sub AddClients(ByVal a() As String)
Try
Dim con As New SqlConnection(ConString)
Dim cmd As New SqlCommand(storename, con)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@ClientName", a(0).Trim)
cmd.Parameters.Add("@ClientAdress", a(1).Trim)
cmd.Parameters.Add("@ClientCompany", a(2).Trim)
cmd.Parameters.Add("@ClientEmail", a(3).Trim)
cmd.Parameters.Add("@ClientTEL", a(4).Trim)
cmd.Parameters.Add("@ClientRemark", a(5).Trim)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "错误")
End Try
End Sub
'修改供应商和购货商信息
Public Shared Sub ModClients(ByVal a() As String)
Try
Dim con As New SqlConnection(ConString)
Dim cmd As New SqlCommand(storename, con)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@ClientID", a(0).Trim)
cmd.Parameters.Add("@ClientName", a(1).Trim)
cmd.Parameters.Add("@ClientAdress", a(2).Trim)
cmd.Parameters.Add("@ClientCompany", a(3).Trim)
cmd.Parameters.Add("@ClientEmail", a(4).Trim)
cmd.Parameters.Add("@ClientTEL", a(5).Trim)
cmd.Parameters.Add("@ClientRemark", a(6).Trim)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "错误")
End Try
End Sub
'删除供应商和购货商信息
Public Shared Sub DelClient(ByVal ID As String)
Try
Dim con As New SqlConnection(ConString)
Dim cmd As New SqlCommand(storename, con)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@ClientID", ID)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "错误")
End Try
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -