⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 超市管理系统是一个超市不可缺少的部分,它的内容对于超市的决策者和管理者来说都至关重要,所以超市管理系统应该能够为用户提供充足的信息和快捷的销售
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.Form frmMain 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "超市管理界面"
   ClientHeight    =   8730
   ClientLeft      =   150
   ClientTop       =   720
   ClientWidth     =   11880
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "frmMain.frx":0000
   ScaleHeight     =   8730
   ScaleWidth      =   11880
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   WindowState     =   2  'Maximized
   Begin VB.Menu mnjiaoyi 
      Caption         =   "交易管理"
      Begin VB.Menu mnBuy 
         Caption         =   "进货登记"
      End
      Begin VB.Menu mnSell 
         Caption         =   "销售登记"
      End
      Begin VB.Menu mnRetreat 
         Caption         =   "退货登记"
      End
   End
   Begin VB.Menu mnBuyAll 
      Caption         =   "进货统计"
      Begin VB.Menu mnBuyToday 
         Caption         =   "今日进货统计"
      End
      Begin VB.Menu mnBuyMonth 
         Caption         =   "本月进货统计"
      End
      Begin VB.Menu mnBuyQuarterly 
         Caption         =   "本季度进货统计"
      End
      Begin VB.Menu mnBuyYear 
         Caption         =   "今年进货统计"
      End
   End
   Begin VB.Menu mnSellAll 
      Caption         =   "销售统计"
      Begin VB.Menu mnSellToday 
         Caption         =   "今日销售统计"
      End
      Begin VB.Menu mnSellMonth 
         Caption         =   "本月销售统计"
      End
      Begin VB.Menu mnSellQuarterly 
         Caption         =   "本季度销售统计"
      End
      Begin VB.Menu mnSellYear 
         Caption         =   "今年销售统计"
      End
   End
   Begin VB.Menu mnTable 
      Caption         =   "查看数据表"
      Begin VB.Menu mnBuyTable 
         Caption         =   "查看进货表"
      End
      Begin VB.Menu mnGoodsTable 
         Caption         =   "查看现存商品表"
      End
      Begin VB.Menu mnSellTable 
         Caption         =   "查看销售表"
      End
      Begin VB.Menu mnRetreatTable 
         Caption         =   "查看退货表"
      End
      Begin VB.Menu mnEmployeeTable 
         Caption         =   "管理员工表"
      End
      Begin VB.Menu mnManufacturerTable 
         Caption         =   "查看进货商表"
      End
   End
   Begin VB.Menu mnxitong 
      Caption         =   "系统管理"
      Begin VB.Menu mnChangeEmployee 
         Caption         =   "更换用户"
      End
      Begin VB.Menu mnChangePwd 
         Caption         =   "修改密码"
      End
      Begin VB.Menu mnExit 
         Caption         =   "退出系统"
      End
      Begin VB.Menu mnabout 
         Caption         =   "关于"
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs_sell As New ADODB.Recordset
Dim rs_goods As New ADODB.Recordset
Dim rs_buy As New ADODB.Recordset
Dim rs_retreat As New ADODB.Recordset
Dim rs_manufacturer As New ADODB.Recordset
Dim rs_employee As New ADODB.Recordset
Dim rs_fctotal As New ADODB.Recordset
Dim rs_total As New ADODB.Recordset
Dim strsell As String
Dim strgoods As String
Dim strbuy As String
Dim strretreat As String
Dim strmanufacturer As String
Dim stremployee As String
Dim strfctotal As String
Dim strtotal As String
Dim inty As Integer
Dim intm As Integer
Dim intd As Integer
Private Sub Form_Load()
inty = Year(Date)
intm = Month(Date)
intd = Day(Date)

End Sub



Private Sub mnabout_Click()
frmAbout.Show
End Sub

Private Sub mnBuy_Click()
frmAddgoods.Show
End Sub

Private Sub mnBuyMonth_Click()
frmBuyall.Text2.Enabled = False
frmBuyall.SSTab1.Tab = 1
frmBuyall.SSTab1.TabEnabled(0) = False
frmBuyall.SSTab1.TabEnabled(1) = True
frmBuyall.SSTab1.TabEnabled(2) = False
frmBuyall.SSTab1.TabEnabled(3) = False
frmBuyall.Show
strbuy = "select * from buy where 进货年=" & inty & " and 进货月=" & intm & " "
rs_buy.Open strbuy, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc2.RecordSource = strbuy
frmBuyall.Adodc2.Refresh
frmBuyall.DataGrid2.ReBind
If rs_buy.EOF = True Then
   frmBuyall.Adodc6.RecordSource = strbuy
   frmBuyall.Adodc6.Refresh
   frmBuyall.DataGrid6.ReBind
   MsgBox "您本月没有进货记录!", vbOKOnly + vbInformation, "注意"
   frmBuyall.Command9.Enabled = False
   frmBuyall.Command10.Enabled = False
   frmBuyall.Command11.Enabled = False
   frmBuyall.Command12.Enabled = False
   frmBuyall.Command13.Enabled = False
   frmBuyall.Command14.Enabled = False
   frmBuyall.Command15.Enabled = False
   frmBuyall.Command16.Enabled = False
   rs_buy.Close
   Exit Sub
End If
rs_buy.Close
strfctotal = "select 生产厂商,sum(总金额) as 各厂商进货总金额 from buy where 进货年=" & inty & " and 进货月=" & intm & " group by 生产厂商"
rs_fctotal.Open strfctotal, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc6.RecordSource = strfctotal
frmBuyall.Adodc6.Refresh
frmBuyall.DataGrid6.ReBind
rs_fctotal.Close
strtotal = "select sum(总金额) as 进货总金额 from buy where 进货年=" & inty & " and 进货月=" & intm & " "
rs_total.Open strtotal, cnn, adOpenKeysetm, adLockPessimistic
frmBuyall.Text2.Text = rs_total.Fields("进货总金额")
rs_total.Close
End Sub

Private Sub mnBuyQuarterly_Click()
frmBuyall.Text3.Enabled = False
frmBuyall.SSTab1.Tab = 2
frmBuyall.SSTab1.TabEnabled(0) = False
frmBuyall.SSTab1.TabEnabled(1) = False
frmBuyall.SSTab1.TabEnabled(2) = True
frmBuyall.SSTab1.TabEnabled(3) = False
frmBuyall.Show
Select Case intm
       Case Is < 4
            intm = 3
       Case Is < 7
            intm = 6
       Case Is < 10
            intm = 9
       Case Is > 10
            intm = 12
End Select
strbuy = "select * from buy where 进货年=" & inty & " and 进货月 between " & (intm - 2) & " and " & intm & " "
rs_buy.Open strbuy, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc2.RecordSource = strbuy
frmBuyall.Adodc2.Refresh
frmBuyall.DataGrid2.ReBind
If rs_buy.EOF = True Then
   frmBuyall.Adodc6.RecordSource = strbuy
   frmBuyall.Adodc6.Refresh
   frmBuyall.DataGrid6.ReBind
   MsgBox "您本季度没有进货记录!", vbOKOnly + vbInformation, "注意"
   frmBuyall.Command17.Enabled = False
   frmBuyall.Command18.Enabled = False
   frmBuyall.Command19.Enabled = False
   frmBuyall.Command20.Enabled = False
   frmBuyall.Command21.Enabled = False
   frmBuyall.Command22.Enabled = False
   frmBuyall.Command23.Enabled = False
   frmBuyall.Command24.Enabled = False
   rs_buy.Close
   Exit Sub
End If
rs_buy.Close
strfctotal = "select 生产厂商,sum(总金额) as 各厂商进货总金额 from buy where 进货年=" & inty & " and 进货月 between " & (intm - 2) & " and " & intm & " group by 生产厂商"
rs_fctotal.Open strfctotal, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc6.RecordSource = strfctotal
frmBuyall.Adodc6.Refresh
frmBuyall.DataGrid6.ReBind
rs_fctotal.Close
strtotal = "select sum(总金额) as 进货总金额 from buy where 进货年=" & inty & " and 进货月 between " & (intm - 2) & " and " & intm & " "
rs_total.Open strtotal, cnn, adOpenKeysetm, adLockPessimistic
frmBuyall.Text3.Text = rs_total.Fields("进货总金额")
rs_total.Close
intm = Month(Date)
End Sub

Private Sub mnBuyTable_Click()
frmBuyTable.Show
End Sub

Private Sub mnBuyToday_Click()
frmBuyall.Text1.Enabled = False
frmBuyall.SSTab1.Tab = 0
frmBuyall.SSTab1.TabEnabled(0) = True
frmBuyall.SSTab1.TabEnabled(1) = False
frmBuyall.SSTab1.TabEnabled(2) = False
frmBuyall.SSTab1.TabEnabled(3) = False
frmBuyall.Show
strbuy = "select * from buy where 进货年=" & inty & " and 进货月=" & intm & " and 进货日=" & intd & " "
rs_buy.Open strbuy, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc1.RecordSource = strbuy
frmBuyall.Adodc1.Refresh
frmBuyall.DataGrid1.ReBind
If rs_buy.EOF = True Then
   frmBuyall.Adodc5.RecordSource = strbuy
   frmBuyall.Adodc5.Refresh
   frmBuyall.DataGrid5.ReBind
   MsgBox "您今日没有进货记录!", vbOKOnly + vbInformation, "注意"
   frmBuyall.Command1.Enabled = False
   frmBuyall.Command2.Enabled = False
   frmBuyall.Command3.Enabled = False
   frmBuyall.Command4.Enabled = False
   frmBuyall.Command5.Enabled = False
   frmBuyall.Command6.Enabled = False
   frmBuyall.Command7.Enabled = False
   frmBuyall.Command8.Enabled = False
   rs_buy.Close
  
   Exit Sub
End If
rs_buy.Close
strfctotal = "select 生产厂商,sum(总金额) as 各厂商进货总金额 from buy where 进货年=" & inty & " and 进货月=" & intm & "and 进货日=" & intd & " group by 生产厂商"
rs_fctotal.Open strfctotal, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc5.RecordSource = strfctotal
frmBuyall.Adodc5.Refresh
frmBuyall.DataGrid5.ReBind
rs_fctotal.Close
strtotal = "select sum(总金额) as 进货总金额 from buy where 进货年=" & inty & " and 进货月=" & intm & "and 进货日=" & intd & ""

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -