?? frmcustomerregister.vb
字號:
Imports System.Data.SqlClientPublic Class frmCustomerRegister Inherits jiudian.frmDataEdit Dim BMStayRecord As BindingManagerBase Public Overrides Sub SetMyData() MyDataSet = DsCustomerRegister1
MyDataItem = "旅客 "
MyConnection = SqlConnection1
End Sub
Public Overrides Sub uploadadddata()
daCustomer.Update(DsCustomerRegister1, "旅客")
daStayRecord.Update(DsCustomerRegister1, "入住記錄")
End Sub
Public Overrides Sub uploadmodifydata()
daCustomer.Update(DsCustomerRegister1, "旅客")
daStayRecord.Update(DsCustomerRegister1, "入住記錄")
End Sub
Public Overrides Sub uploaddeletedata()
daCustomer.Update(DsCustomerRegister1, "旅客")
daStayRecord.Update(DsCustomerRegister1, "入住記錄")
End Sub
Public Overrides Sub filldata()
daCustomer.Fill(DsCustomerRegister1)
daStayRecord.Fill(DsCustomerRegister1)
showposition()
End Sub
#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 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 SqlConnection1 As System.Data.SqlClient.SqlConnection
Friend WithEvents daCustomer As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents SqlSelectCommand2 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand2 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlUpdateCommand2 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlDeleteCommand2 As System.Data.SqlClient.SqlCommand
Friend WithEvents daStayRecord As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents DsCustomerRegister1 As jiudian.dsCustomerRegister
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents txtCustomerID As System.Windows.Forms.TextBox
Friend WithEvents txtCustomerName As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents txtCustomerSex As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents txtWorkUnit As System.Windows.Forms.TextBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents txtPosition As System.Windows.Forms.TextBox
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents txtTitle As System.Windows.Forms.TextBox
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents txtGuest As System.Windows.Forms.TextBox
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents txtSearch As System.Windows.Forms.TextBox
Friend WithEvents btnSearch As System.Windows.Forms.Button
Friend WithEvents btnAddStayRecord As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand
Me.daCustomer = New System.Data.SqlClient.SqlDataAdapter
Me.SqlSelectCommand2 = New System.Data.SqlClient.SqlCommand
Me.SqlInsertCommand2 = New System.Data.SqlClient.SqlCommand
Me.SqlUpdateCommand2 = New System.Data.SqlClient.SqlCommand
Me.SqlDeleteCommand2 = New System.Data.SqlClient.SqlCommand
Me.daStayRecord = New System.Data.SqlClient.SqlDataAdapter
Me.DsCustomerRegister1 = New jiudian.dsCustomerRegister
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.txtCustomerID = New System.Windows.Forms.TextBox
Me.txtCustomerName = New System.Windows.Forms.TextBox
Me.Label3 = New System.Windows.Forms.Label
Me.txtCustomerSex = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.txtWorkUnit = New System.Windows.Forms.TextBox
Me.Label5 = New System.Windows.Forms.Label
Me.txtPosition = New System.Windows.Forms.TextBox
Me.Label6 = New System.Windows.Forms.Label
Me.txtTitle = New System.Windows.Forms.TextBox
Me.Label7 = New System.Windows.Forms.Label
Me.txtGuest = New System.Windows.Forms.TextBox
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.Label8 = New System.Windows.Forms.Label
Me.txtSearch = New System.Windows.Forms.TextBox
Me.btnSearch = New System.Windows.Forms.Button
Me.btnAddStayRecord = New System.Windows.Forms.Button
CType(Me.DsCustomerRegister1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT 身份證號碼, 姓名, 性別, 工作單位, 職務, 職稱, 貴賓 FROM 旅客"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "workstation id=4D3A93FBF8BE4E6;packet size=4096;user id=sa;data source=4D3A93FBF8" & _
"BE4E6;persist security info=False;initial catalog=sqlqtgl"
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO 旅客(身份證號碼, 姓名, 性別, 工作單位, 職務, 職稱, 貴賓) VALUES (@身份證號碼, @姓名, @性別, @工作單位, " & _
"@職務, @職稱, @貴賓); SELECT 身份證號碼, 姓名, 性別, 工作單位, 職務, 職稱, 貴賓 FROM 旅客 WHERE (身份證號碼 = @身" & _
"份證號碼)"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@身份證號碼", System.Data.SqlDbType.VarChar, 18, "身份證號碼"))
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, 2, "性別"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@工作單位", System.Data.SqlDbType.VarChar, 50, "工作單位"))
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, 1, "貴賓"))
'
'SqlUpdateCommand1
'
Me.SqlUpdateCommand1.CommandText = "UPDATE 旅客 SET 身份證號碼 = @身份證號碼, 姓名 = @姓名, 性別 = @性別, 工作單位 = @工作單位, 職務 = @職務, 職稱 = @職" & _
"稱, 貴賓 = @貴賓 WHERE (身份證號碼 = @Original_身份證號碼) AND (姓名 = @Original_姓名) AND (工作單位 = " & _
"@Original_工作單位 OR @Original_工作單位 IS NULL AND 工作單位 IS NULL) AND (性別 = @Original_性" & _
"別) AND (職務 = @Original_職務 OR @Original_職務 IS NULL AND 職務 IS NULL) AND (職稱 = @Ori" & _
"ginal_職稱 OR @Original_職稱 IS NULL AND 職稱 IS NULL) AND (貴賓 = @Original_貴賓 OR @Orig" & _
"inal_貴賓 IS NULL AND 貴賓 IS NULL); SELECT 身份證號碼, 姓名, 性別, 工作單位, 職務, 職稱, 貴賓 FROM 旅客 " & _
"WHERE (身份證號碼 = @身份證號碼)"
Me.SqlUpdateCommand1.Connection = Me.SqlConnection1
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@身份證號碼", System.Data.SqlDbType.VarChar, 18, "身份證號碼"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.VarChar, 20, "姓名"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@性別", System.Data.SqlDbType.VarChar, 2, "性別"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@工作單位", System.Data.SqlDbType.VarChar, 50, "工作單位"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@職務", System.Data.SqlDbType.VarChar, 10, "職務"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@職稱", System.Data.SqlDbType.VarChar, 10, "職稱"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@貴賓", System.Data.SqlDbType.VarChar, 1, "貴賓"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_身份證號碼", System.Data.SqlDbType.VarChar, 18, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "身份證號碼", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_姓名", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "姓名", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_工作單位", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "工作單位", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_性別", System.Data.SqlDbType.VarChar, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "性別", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_職務", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "職務", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_職稱", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "職稱", System.Data.DataRowVersion.Original, Nothing))
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -