📄 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 + -