49 lines
1.8 KiB
VB.net
49 lines
1.8 KiB
VB.net
Public Class FrmAddDevice
|
|
|
|
''' <summary>
|
|
''' 设备列表表名
|
|
''' </summary>
|
|
Private _DevLists As String = $"CSeries_DevLists"
|
|
|
|
|
|
''' <summary>
|
|
''' 保存按键
|
|
''' </summary>
|
|
''' <param name="sender"></param>
|
|
''' <param name="e"></param>
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
If TextIsNull(TextBox1, "设备型号") = False Then Exit Sub
|
|
If TextIsNull(TextBox2, "设备类型") = False Then Exit Sub
|
|
If TextIsNull(TextBox3, "设备名称") = False Then Exit Sub
|
|
If TextIsNull(TextBox4, "协议编号") = False Then Exit Sub
|
|
If TextIsNull(TextBox5, "波特率") = False Then Exit Sub
|
|
If TextIsNull(TextBox6, "功能说明") = False Then Exit Sub
|
|
|
|
Dim devTypeNumber As String = TextBox1.Text '设备型号
|
|
Dim devType As String = TextBox2.Text '设备类型
|
|
Dim devName As String = TextBox3.Text '设备名称
|
|
Dim devxieyi As String = TextBox4.Text '协议编号
|
|
Dim devBaud As String = TextBox5.Text '波特率
|
|
Dim functionExplain As String = TextBox5.Text '功能说明
|
|
Dim remarks As String = TextBox6.Text '备注
|
|
|
|
Dim conditions As String = $"(DevTypeNumber, DevType, DevName, DevProtocol, DevBaud, FunctionalExplain, Remarks) Values('{devTypeNumber}', '{devType}', '{devName}', '{devxieyi}', '{devBaud}', '{functionExplain}', '{remarks}')"
|
|
_SqlServer.Add(_DevLists, conditions)
|
|
|
|
MsgBox($"新增完成")
|
|
End Sub
|
|
|
|
|
|
''' <summary>
|
|
''' 关闭窗体按键
|
|
''' </summary>
|
|
''' <param name="sender"></param>
|
|
''' <param name="e"></param>
|
|
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
|
Close()
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
End Class |