?? remarkform.vb
字號:
Imports System.Data.SqlClient
Public Class RemarkForm
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 lbNo As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents btOK As System.Windows.Forms.Button
Friend WithEvents tbRemark As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.lbNo = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.btOK = New System.Windows.Forms.Button
Me.tbRemark = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'lbNo
'
Me.lbNo.Location = New System.Drawing.Point(152, 16)
Me.lbNo.Name = "lbNo"
Me.lbNo.Size = New System.Drawing.Size(80, 23)
Me.lbNo.TabIndex = 7
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(32, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(88, 23)
Me.Label1.TabIndex = 6
Me.Label1.Text = "編號"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'btOK
'
Me.btOK.DialogResult = System.Windows.Forms.DialogResult.OK
Me.btOK.Location = New System.Drawing.Point(144, 48)
Me.btOK.Name = "btOK"
Me.btOK.TabIndex = 5
Me.btOK.Text = "確定"
'
'tbRemark
'
Me.tbRemark.Location = New System.Drawing.Point(16, 48)
Me.tbRemark.Name = "tbRemark"
Me.tbRemark.Size = New System.Drawing.Size(112, 21)
Me.tbRemark.TabIndex = 27
Me.tbRemark.Text = ""
'
'RemarkForm
'
Me.AcceptButton = Me.btOK
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(272, 88)
Me.Controls.Add(Me.tbRemark)
Me.Controls.Add(Me.lbNo)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.btOK)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.Name = "RemarkForm"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "備注修改"
Me.ResumeLayout(False)
End Sub
#End Region
Public no As String = String.Empty
Public Remark As String = String.Empty
Public flag As Boolean = True
Private Sub RemarkForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.lbNo.Text = no.Trim()
Me.tbRemark.Text = Me.Remark.Trim()
End Sub
Private Sub btOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btOK.Click
Dim sql As String = "UPDATE ORDERNOTE SET HANDLER = '" + Sample02.UserId.Trim() + " ',REMARK = " + Me.tbRemark.Text.Trim() + " WHERE ORDERNO = '" + Me.no.Trim() + "'"
Dim SqlCmd As New SqlCommand(sql, Sample02.SqlCon)
If flag Then
Try
Sample02.SqlCon.Open()
SqlCmd.ExecuteNonQuery()
Me.flag = True
MessageBox.Show("更新成功")
Catch ex As Exception
Me.flag = False
Sample02.WriteErr(ex)
MessageBox.Show("更新失敗")
Finally
Sample02.SqlCon.Close()
End Try
Me.Close()
End If
End Sub
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -