📄 frmmps.vb
字号:
Me.txbBegDate.ReadOnly = True
Me.txbBegDate.TabIndex = 21
Me.txbBegDate.Text = ""
'
'Label8
'
Me.Label8.Location = New System.Drawing.Point(40, 80)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(64, 16)
Me.Label8.TabIndex = 20
Me.Label8.Text = "开始日期"
'
'txbPlanDate
'
Me.txbPlanDate.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DataSet11, "主生产计划.计划期"))
Me.txbPlanDate.Location = New System.Drawing.Point(336, 45)
Me.txbPlanDate.Name = "txbPlanDate"
Me.txbPlanDate.ReadOnly = True
Me.txbPlanDate.TabIndex = 19
Me.txbPlanDate.Text = ""
'
'Label7
'
Me.Label7.Location = New System.Drawing.Point(288, 51)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(56, 16)
Me.Label7.TabIndex = 18
Me.Label7.Text = "计划期"
'
'txbDate
'
Me.txbDate.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DataSet11, "主生产计划.年份"))
Me.txbDate.Location = New System.Drawing.Point(96, 45)
Me.txbDate.Name = "txbDate"
Me.txbDate.ReadOnly = True
Me.txbDate.TabIndex = 17
Me.txbDate.Text = ""
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(65, 49)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(32, 16)
Me.Label6.TabIndex = 16
Me.Label6.Text = "年份"
'
'txbName
'
Me.txbName.Location = New System.Drawing.Point(336, 16)
Me.txbName.Name = "txbName"
Me.txbName.ReadOnly = True
Me.txbName.TabIndex = 15
Me.txbName.Text = ""
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(280, 24)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(64, 16)
Me.Label5.TabIndex = 14
Me.Label5.Text = "产品名称"
'
'txbID
'
Me.txbID.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DataSet11, "主生产计划.物料编号"))
Me.txbID.Location = New System.Drawing.Point(96, 16)
Me.txbID.Name = "txbID"
Me.txbID.ReadOnly = True
Me.txbID.TabIndex = 13
Me.txbID.Text = ""
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(42, 24)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(64, 16)
Me.Label4.TabIndex = 12
Me.Label4.Text = "产品编号"
'
'GroupBox2
'
Me.GroupBox2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.GroupBox2.Controls.Add(Me.dgdDetailList)
Me.GroupBox2.Controls.Add(Me.btnSubmit)
Me.GroupBox2.Location = New System.Drawing.Point(208, 280)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(496, 112)
Me.GroupBox2.TabIndex = 5
Me.GroupBox2.TabStop = False
'
'dgdDetailList
'
Me.dgdDetailList.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.dgdDetailList.CaptionVisible = False
Me.dgdDetailList.DataMember = ""
Me.dgdDetailList.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.dgdDetailList.Location = New System.Drawing.Point(8, 48)
Me.dgdDetailList.Name = "dgdDetailList"
Me.dgdDetailList.Size = New System.Drawing.Size(480, 56)
Me.dgdDetailList.TabIndex = 1
'
'btnSubmit
'
Me.btnSubmit.Location = New System.Drawing.Point(24, 16)
Me.btnSubmit.Name = "btnSubmit"
Me.btnSubmit.Size = New System.Drawing.Size(136, 23)
Me.btnSubmit.TabIndex = 0
Me.btnSubmit.Text = "由需求计划导入"
'
'frmMPS
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(704, 397)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Name = "frmMPS"
Me.Controls.SetChildIndex(Me.GroupBox1, 0)
Me.Controls.SetChildIndex(Me.GroupBox2, 0)
Me.GroupBox1.ResumeLayout(False)
CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).EndInit()
Me.GroupBox2.ResumeLayout(False)
CType(Me.dgdDetailList, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Public Overrides Sub Prepare()
Me.Text = "主生产计划维护"
Me.Label1.Text = "物料编号"
Me.Label2.Text = " 年份"
Me.Label3.Text = " 计划期"
End Sub
Public Overrides Sub SetDataGrid()
LoadData()
'定义一个DataGrid表样式
Dim ts As New DataGridTableStyle
Dim aColumnTextColumn As DataGridTextBoxColumn
Dim numCols As Integer = dtData.Columns.Count
Dim i As Integer
For i = 0 To numCols - 1
If i <> 1 Then
aColumnTextColumn = New DataGridTextBoxColumn
aColumnTextColumn.MappingName = _
dtData.Columns(i).ColumnName
aColumnTextColumn.HeaderText = _
dtData.Columns(i).ColumnName
aColumnTextColumn.NullText = ""
aColumnTextColumn.Width = 60
ts.GridColumnStyles.Add(aColumnTextColumn)
End If
Next
ts.AlternatingBackColor = Color.LightGray
ts.AllowSorting = False
ts.MappingName = dtData.TableName
dgdList.TableStyles.Add(ts)
Dim dv As DataView = dtData.DefaultView
dv.AllowNew = False
dv.AllowDelete = False
dv.AllowEdit = False
dgdList.DataSource = dtData.DefaultView
bmData = Me.BindingContext(Me.DataSet11, "主生产计划")
Dim db As DataBase = New DataBase
If dtData.Rows.Count > 0 Then
Dim dvTemp As DataView
Dim strSQL As String = "select 物料名称 from 物料主文件 where 物料编号='"
strSQL += dtData.Rows(0)("物料编号") + "'"
dvTemp = db.RunSelectSQL(strSQL)
If dvTemp Is Nothing = False Then
Me.txbName.Text = dvTemp(0)(0).ToString()
End If
End If
db.Dispose()
SetForDetailList()
End Sub
Private Sub SetForDetailList()
Dim db As DataBase = New DataBase
dvDetailResult = db.RunSelectSQL("select a.物料编号,物料名称,年份,计划期,需求数量,开始日期,结束日期,状态 from 主需求计划 as a ,物料主文件 as b where a.物料编号 = b.物料编号")
Dim ts As DataGridTableStyle = New DataGridTableStyle
Dim aColumnTextColumn As DataGridTextBoxColumn
Dim numCols As Integer = dvDetailResult.Table.Columns.Count
Dim i As Integer
For i = 0 To numCols - 1
aColumnTextColumn = New DataGridTextBoxColumn
aColumnTextColumn.MappingName = _
dtData.Columns(i).ColumnName
aColumnTextColumn.HeaderText = _
dtData.Columns(i).ColumnName
aColumnTextColumn.NullText = ""
aColumnTextColumn.Width = 50
ts.GridColumnStyles.Add(aColumnTextColumn)
Next
ts.AlternatingBackColor = Color.LightGray
ts.AllowSorting = False
dgdDetailList.TableStyles.Clear()
dgdDetailList.TableStyles.Add(ts)
dvDetailResult.AllowNew = False
dvDetailResult.AllowDelete = False
dvDetailResult.AllowEdit = False
dgdDetailList.DataSource = dvDetailResult
End Sub
Private Sub btnProduct_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProduct.Click
Try
Dim dlgSelect As frmSelect = New frmSelect
dlgSelect.ShowDialog()
Dim sResult() As String = dlgSelect.GetInfo().Trim.Split("|")
txbID.Text = sResult(0)
txbName.Text = sResult(1)
Catch ex As Exception
MessageBox.Show(ex.ToString)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -