📄 form7.vb
字号:
Public Class Form7
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Friend WithEvents SqlCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlUpdateCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlDeleteCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents DataSet11 As 门禁管理系统.DataSet1
Friend WithEvents AxMSComm1 As AxMSCommLib.AxMSComm
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form7))
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Label1 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.SqlCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand
Me.DataSet11 = New 门禁管理系统.DataSet1
Me.AxMSComm1 = New AxMSCommLib.AxMSComm
Me.Button3 = New System.Windows.Forms.Button
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.AxMSComm1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'DataGrid1
'
Me.DataGrid1.DataMember = ""
Me.DataGrid1.DataSource = Me.DataSet11.刷卡记录
Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(32, 16)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.Size = New System.Drawing.Size(512, 112)
Me.DataGrid1.TabIndex = 0
'
'Button1
'
Me.Button1.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button1.ForeColor = System.Drawing.SystemColors.Desktop
Me.Button1.Location = New System.Drawing.Point(320, 184)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(72, 32)
Me.Button1.TabIndex = 1
Me.Button1.Text = "查询"
'
'Button2
'
Me.Button2.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button2.ForeColor = System.Drawing.SystemColors.Desktop
Me.Button2.Location = New System.Drawing.Point(456, 184)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(72, 32)
Me.Button2.TabIndex = 2
Me.Button2.Text = "取消"
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label1.ForeColor = System.Drawing.SystemColors.Desktop
Me.Label1.Location = New System.Drawing.Point(64, 152)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(64, 24)
Me.Label1.TabIndex = 3
Me.Label1.Text = "IC卡号"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(160, 152)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(112, 21)
Me.TextBox1.TabIndex = 4
Me.TextBox1.Text = ""
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.DeleteCommand = Me.SqlDeleteCommand1
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "刷卡记录", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("IC卡号", "IC卡号"), New System.Data.Common.DataColumnMapping("姓名", "姓名"), New System.Data.Common.DataColumnMapping("班级", "班级"), New System.Data.Common.DataColumnMapping("学号", "学号"), New System.Data.Common.DataColumnMapping("专业", "专业"), New System.Data.Common.DataColumnMapping("刷卡日期", "刷卡日期"), New System.Data.Common.DataColumnMapping("刷卡时间", "刷卡时间")})})
Me.SqlDataAdapter1.UpdateCommand = Me.SqlUpdateCommand1
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "workstation id=levono03;packet size=4096;integrated security=SSPI;data source=lev" & _
"ono03;persist security info=False;initial catalog=门禁系统信息"
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT IC卡号, 姓名, 班级, 学号, 专业, 刷卡日期, 刷卡时间 FROM 刷卡记录"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO 刷卡记录(IC卡号, 姓名, 班级, 学号, 专业, 刷卡日期, 刷卡时间) VALUES (@IC卡号, @姓名, @班级, @学号, " & _
"@专业, @刷卡日期, @刷卡时间); SELECT IC卡号, 姓名, 班级, 学号, 专业, 刷卡日期, 刷卡时间 FROM 刷卡记录 WHERE (IC卡" & _
"号 = @IC卡号)"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@IC卡号", System.Data.SqlDbType.VarChar, 20, "IC卡号"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.VarChar, 10, "姓名"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@班级", System.Data.SqlDbType.VarChar, 10, "班级"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@学号", System.Data.SqlDbType.VarChar, 20, "学号"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@专业", System.Data.SqlDbType.VarChar, 20, "专业"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@刷卡日期", System.Data.SqlDbType.VarChar, 20, "刷卡日期"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@刷卡时间", System.Data.SqlDbType.VarChar, 20, "刷卡时间"))
'
'SqlUpdateCommand1
'
Me.SqlUpdateCommand1.CommandText = "UPDATE 刷卡记录 SET IC卡号 = @IC卡号, 姓名 = @姓名, 班级 = @班级, 学号 = @学号, 专业 = @专业, 刷卡日期 = @刷卡日" & _
"期, 刷卡时间 = @刷卡时间 WHERE (IC卡号 = @Original_IC卡号) AND (专业 = @Original_专业 OR @Origina" & _
"l_专业 IS NULL AND 专业 IS NULL) AND (刷卡日期 = @Original_刷卡日期 OR @Original_刷卡日期 IS NUL" & _
"L AND 刷卡日期 IS NULL) AND (刷卡时间 = @Original_刷卡时间 OR @Original_刷卡时间 IS NULL AND 刷卡时" & _
"间 IS NULL) AND (姓名 = @Original_姓名 OR @Original_姓名 IS NULL AND 姓名 IS NULL) AND (学" & _
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -