client.vb
来自「本文件为进销存管理系统的代码 在VB的环境下运行 用比较简单的结构完成的」· VB 代码 · 共 63 行
VB
63 行
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 + =
减小字号Ctrl + -
显示快捷键?