📄 pd_xiangmujingli.vb
字号:
Public Class pd_xiangmujingli
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 TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.ComboBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
Friend WithEvents Label6 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.TextBox2 = New System.Windows.Forms.ComboBox
Me.Label3 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.Button1 = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.ComboBox1 = New System.Windows.Forms.ComboBox
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.TextBox4 = New System.Windows.Forms.TextBox
Me.Label5 = New System.Windows.Forms.Label
Me.TextBox5 = New System.Windows.Forms.TextBox
Me.Label6 = New System.Windows.Forms.Label
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(112, 96)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.ReadOnly = True
Me.TextBox3.Size = New System.Drawing.Size(360, 21)
Me.TextBox3.TabIndex = 62
Me.TextBox3.Text = "TextBox3"
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(112, 32)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(360, 20)
Me.TextBox2.TabIndex = 59
Me.TextBox2.Text = "盘点编号"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(32, 96)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(64, 24)
Me.Label3.TabIndex = 61
Me.Label3.Text = "工程名称"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(32, 32)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(64, 24)
Me.Label2.TabIndex = 60
Me.Label2.Text = "盘点编号"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'GroupBox1
'
Me.GroupBox1.Location = New System.Drawing.Point(16, 8)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(480, 128)
Me.GroupBox1.TabIndex = 63
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "工程信息区"
'
'DataGrid1
'
Me.DataGrid1.DataMember = ""
Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(16, 144)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.ReadOnly = True
Me.DataGrid1.Size = New System.Drawing.Size(480, 184)
Me.DataGrid1.TabIndex = 64
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(400, 360)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(80, 24)
Me.Button1.TabIndex = 65
Me.Button1.Text = "确 定"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(80, 360)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.TextBox1.Size = New System.Drawing.Size(64, 21)
Me.TextBox1.TabIndex = 66
Me.TextBox1.Text = ""
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 360)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(48, 23)
Me.Label1.TabIndex = 67
Me.Label1.Text = "密码:"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(152, 360)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(48, 16)
Me.Label4.TabIndex = 69
Me.Label4.Text = "意见:"
'
'ComboBox1
'
Me.ComboBox1.Items.AddRange(New Object() {"同意", "不同意"})
Me.ComboBox1.Location = New System.Drawing.Point(320, 360)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(56, 20)
Me.ComboBox1.TabIndex = 70
Me.ComboBox1.Text = "同意"
'
'GroupBox2
'
Me.GroupBox2.Location = New System.Drawing.Point(16, 336)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(480, 56)
Me.GroupBox2.TabIndex = 71
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "操 作 区"
'
'TextBox4
'
Me.TextBox4.Location = New System.Drawing.Point(112, 64)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.ReadOnly = True
Me.TextBox4.Size = New System.Drawing.Size(360, 21)
Me.TextBox4.TabIndex = 73
Me.TextBox4.Text = "TextBox4"
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(32, 64)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(64, 24)
Me.Label5.TabIndex = 72
Me.Label5.Text = "工程编号"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'TextBox5
'
Me.TextBox5.Location = New System.Drawing.Point(200, 360)
Me.TextBox5.Name = "TextBox5"
Me.TextBox5.Size = New System.Drawing.Size(64, 21)
Me.TextBox5.TabIndex = 74
Me.TextBox5.Text = ""
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(272, 360)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(48, 16)
Me.Label6.TabIndex = 75
Me.Label6.Text = "结果:"
'
'pd_xiangmujingli
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(512, 406)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.TextBox5)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.DataGrid1)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.GroupBox2)
Me.MaximizeBox = False
Me.Name = "pd_xiangmujingli"
Me.Text = "项目经理盘点确认"
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub pd_xiangmujingli_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
gongchengbianhao()
End Sub
'根据盘点编号,显示工程名称,工程编号
Private Sub TextBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.SelectedIndexChanged
Dim str As String
Dim sstr As String = TextBox2.Text.Trim
str = "select * from gongcheng_pandian where 盘点编号 = " + Chr(39) + sstr + Chr(39)
Dim mydataset As New DataSet
mydataset = GetDataFromDB(str)
TextBox3.Text = mydataset.Tables(0).Rows(0)("工程名称")
TextBox4.Text = mydataset.Tables(0).Rows(0)("工程编号")
DataGrid1.DataSource = mydataset
mydataset.Dispose()
End Sub
'显示所有的盘点编号
Private Sub gongchengbianhao()
Dim str As String
Dim sstr As String
Dim mydataset As New DataSet
Dim i As Integer
Dim y As Integer
str = "select 盘点编号 from gongcheng_pandian where 流程 = " + Chr(39) + "1" + Chr(39)
mydataset = GetDataFromDB(str)
y = mydataset.Tables(0).Rows.Count
TextBox2.Items.Clear()
For i = 0 To y - 1
sstr = Trim(mydataset.Tables(0).Rows(i)("盘点编号"))
TextBox2.Items.Add(sstr)
Next
mydataset.Dispose()
End Sub
'审 批
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'判断用户提交的合法性
Dim mystr As String = TextBox1.Text.Trim
Dim str As String = "select user_pwd from UserInfo where user_id =" + Chr(39) + user_id_yj.Trim + Chr(39) + " and user_pwd =" + Chr(39) + mystr + Chr(39)
If GetDataFromDB(str).Tables(0).Rows.Count = 0 Then
MsgBox("您的密码错误,请重新输入!", MsgBoxStyle.Information, "提示")
TextBox1.Text = ""
TextBox1.Focus()
Exit Sub
End If
Dim sqlstr As String
sqlstr = "UPDATE gongcheng_pandian SET 项目经理审批时间=" + Chr(39) + Now.Date.ToString + Chr(39) + " , 项目经理 =" + Chr(39) + UserName.Trim + Chr(39) + ",项目经理审批意见=" + Chr(39) + TextBox5.Text.Trim + Chr(39) + ",项目经理审批结果=" + Chr(39) + ComboBox1.Text.Trim + Chr(39) + ",流程=" + Chr(39) + "2" + Chr(39) + "where 盘点编号 =" + Chr(39) + TextBox2.Text.Trim + Chr(39)
If UpdateData(sqlstr) = True Then
MsgBox("已经成功审批了该盘点资料", MsgBoxStyle.OKOnly + _
MsgBoxStyle.Exclamation, "提示")
gongchengbianhao()
Else
MsgBox("没有成功审批该盘点资料,请与管理员联系", MsgBoxStyle.OKOnly + _
MsgBoxStyle.Exclamation, "提示")
Exit Sub
End If
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.Text = "同意" Then
Button1.Text = "确 定"
Else
Button1.Text = "退 回"
End If
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -