📄 frmmain.vb
字号:
'
'mnuWindowCascade
'
Me.mnuWindowCascade.Index = 0
Me.mnuWindowCascade.Text = "层叠"
'
'mnuWindowTileHorizontal
'
Me.mnuWindowTileHorizontal.Index = 1
Me.mnuWindowTileHorizontal.Text = "横向平铺"
'
'mnuWindowTileVertical
'
Me.mnuWindowTileVertical.Index = 2
Me.mnuWindowTileVertical.Text = "纵向平铺"
'
'mnuHelp
'
Me.mnuHelp.Index = 6
Me.mnuHelp.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuHelpAbout})
Me.mnuHelp.Text = "帮助"
'
'mnuHelpAbout
'
Me.mnuHelpAbout.Index = 0
Me.mnuHelpAbout.Text = "关于"
'
'FrmMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(656, 289)
Me.Controls.Add(Me.StatusBar1)
Me.IsMdiContainer = True
Me.Menu = Me.MainMenu1
Me.Name = "FrmMain"
Me.Text = "XX公司进销存管理系统"
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.StatusBarPanel2, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub FrmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
mnuDatabase.Enabled = False
mnuTrade.Enabled = False
mnuStatistics.Enabled = False
mnuReport.Enabled = False
mnuBusinessman.Enabled = False
mnuCustomer.Enabled = False
mnuFactory.Enabled = False
mnuProduct.Enabled = False
mnuProductInput.Enabled = False
mnuProductOutput.Enabled = False
mnuRetreat.Enabled = False
mnuStore.Enabled = False
End Sub
Private Sub mnuBusinessman_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuBusinessman.Click
Dim newwindow As New frmBusinessman
newwindow.MdiParent = Me
newwindow.Show()
CurrentTable = "Businessman"
BusinessmanTableOpened = True
TableMenuEnable()
End Sub
Private Sub mnuCustomer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCustomer.Click
Dim newwindow As New frmCustomer
newwindow.MdiParent = Me
newwindow.Show()
CurrentTable = "Customer"
CustomerTableOpened = True
TableMenuEnable()
End Sub
Private Sub mnuWindowCascade_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWindowCascade.Click
Me.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade)
End Sub
Private Sub mnuLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuLogin.Click
Dim newwindow As New frmLogin
newwindow.Show()
End Sub
Private Sub mnuLogout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuLogout.Click
If UID = "" Then
MsgBox("没有用户登陆!", , "注销")
Exit Sub
End If
Do
Dim tempChild As Form = Me.ActiveMdiChild
If (Not tempChild Is Nothing) Then
tempChild.Close()
Else
Exit Do
End If
Loop
db.ConnectionString = ""
MsgBox(UID & "用户注销成功!", , "注销")
UID = ""
PWD = ""
myDataBase = ""
myServer = ""
mnuTrade.Enabled = False
mnuStatistics.Enabled = False
mnuReport.Enabled = False
mnuBusinessman.Enabled = False
mnuCustomer.Enabled = False
mnuFactory.Enabled = False
mnuProduct.Enabled = False
mnuProductInput.Enabled = False
mnuProductOutput.Enabled = False
mnuRetreat.Enabled = False
mnuStore.Enabled = False
mnuDatabase.Enabled = False
End Sub
Private Sub mnuFactory_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFactory.Click
Dim newwindow As New frmFactory
newwindow.MdiParent = Me
newwindow.Show()
CurrentTable = "Factory"
FactoryTableOpened = True
TableMenuEnable()
End Sub
Private Sub mnuProduct_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuProduct.Click
Dim newwindow As New frmProduct
newwindow.MdiParent = Me
newwindow.Show()
CurrentTable = "Produce:"
ProductTableOpened = True
TableMenuEnable()
End Sub
Private Sub mnuStore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuStore.Click
Dim newwindow As New frmStoreTable
newwindow.MdiParent = Me
newwindow.Show()
CurrentTable = "StoreTable"
StoreTableOpened = True
TableMenuEnable()
End Sub
Private Sub mnuProductInput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuProductInput.Click
Dim newwindow As New frmInputTable
newwindow.MdiParent = Me
newwindow.Show()
CurrentTable = "InputTable"
InputTableOpened = True
TableMenuEnable()
End Sub
Private Sub mnuProductOutput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuProductOutput.Click
Dim newwindow As New frmOutputTable
newwindow.MdiParent = Me
newwindow.Show()
CurrentTable = "OutputTable"
OutputTableOpened = True
TableMenuEnable()
End Sub
Private Sub mnuRetreat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuRetreat.Click
Dim newwindow As New frmRetreatTable
newwindow.MdiParent = Me
newwindow.Show()
CurrentTable = "RetreatTable"
RetreatTableOpened = True
TableMenuEnable()
End Sub
Private Sub mnuBS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuBS.Click
WhatToOrder = "BS"
Dim newwindow As New frmOrder
newwindow.MdiParent = Me
newwindow.Show()
End Sub
Private Sub mnuBT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuBT.Click
WhatToOrder = "BT"
Dim newwindow As New frmOrder
newwindow.MdiParent = Me
newwindow.Show()
End Sub
Private Sub mnuPRC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPRC.Click
WhatToOrder = "PRC"
Dim newwindow As New frmOrder
newwindow.MdiParent = Me
newwindow.Show()
End Sub
Private Sub mnuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click
Me.Close()
If db.connectionstring <> "" Then
db.connectionstring = ""
UID = ""
PWD = ""
myDataBase = ""
myServer = ""
End If
Application.Exit()
End Sub
Private Sub mnuHelpAbout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuHelpAbout.Click
Dim newwindow As New frmAbout
newwindow.MdiParent = Me
newwindow.Show()
End Sub
Private Sub mnuITC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuITC.Click
WhatToOrder = "ITC"
Dim newwindow As New frmOrder
newwindow.MdiParent = Me
newwindow.Show()
End Sub
Private Sub mnuInput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuInput.Click
Dim newwindow As New frmInput
newwindow.MdiParent = Me
newwindow.Show()
mnuTrade.MenuItems(0).Enabled = False
End Sub
Private Sub mnuOutput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOutput.Click
Dim newwindow As New frmOutput
newwindow.MdiParent = Me
newwindow.Show()
mnuTrade.MenuItems(1).Enabled = False
End Sub
Private Sub mnuPOC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPOC.Click
WhatToOrder = "POC"
Dim newwindow As New frmOrder
newwindow.MdiParent = Me
newwindow.Show()
End Sub
Private Sub mnuReturn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuReturn.Click
Dim newwindow As New frmRetreat
newwindow.MdiParent = Me
newwindow.Show()
mnuTrade.MenuItems(2).Enabled = False
End Sub
Private Sub mnuCBC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCBC.Click
WhatToOrder = "CBC"
Dim newwindow As New frmOrder
newwindow.MdiParent = Me
newwindow.Show()
mnuReport.MenuItems(1).Enabled = False
End Sub
Private Sub mnuTMSR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuTMSR.Click
ReportDays = 30
Dim newwindow As New frmReport
newwindow.MdiParent = Me
newwindow.Show()
mnuReport.MenuItems(1).Enabled = False
End Sub
Private Sub mnuTWSR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuTWSR.Click
ReportDays = 7
Dim newwindow As New frmReport
newwindow.MdiParent = Me
newwindow.Show()
mnuReport.MenuItems(0).Enabled = False
End Sub
Private Sub mnuWindowTileHorizontal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWindowTileHorizontal.Click
Me.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal)
End Sub
Private Sub mnuWindowTileVertical_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWindowTileVertical.Click
Me.LayoutMdi(System.Windows.Forms.MdiLayout.TileVertical)
End Sub
Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub
Private Sub FrmMain_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
If db.ConnectionString <> "" Then
db.ConnectionString = ""
UID = ""
PWD = ""
myDataBase = ""
myServer = ""
End If
Application.Exit()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -