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

📄 frmplanstock.frm

📁 超市销售管理系统 4) 文档里面有完整的需求说明书
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmPlanStock 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "计划进货"
   ClientHeight    =   5670
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6450
   Icon            =   "frmPlanStock.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   378
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   430
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   1440
      Top             =   4080
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   1
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmPlanStock.frx":000C
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ListView List1 
      Height          =   4470
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   6180
      _ExtentX        =   10901
      _ExtentY        =   7885
      View            =   3
      LabelEdit       =   1
      MultiSelect     =   -1  'True
      LabelWrap       =   -1  'True
      HideSelection   =   0   'False
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      SmallIcons      =   "ImageList1"
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      Appearance      =   1
      NumItems        =   4
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "商品名称"
         Object.Width           =   3175
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "计划进货数量"
         Object.Width           =   2381
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "计划进货日期"
         Object.Width           =   2381
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "当前库存量"
         Object.Width           =   2646
      EndProperty
   End
   Begin SuperMarket.FTextBox txtDate 
      Height          =   300
      Left            =   4200
      TabIndex        =   1
      Top             =   4710
      Width           =   1515
      _ExtentX        =   2672
      _ExtentY        =   529
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      FontName        =   "宋体"
      FontSize        =   9
      AutoSelAll      =   -1  'True
   End
   Begin SuperMarket.FTextBox txtNum 
      Height          =   300
      Left            =   1440
      TabIndex        =   2
      Top             =   4710
      Width           =   1155
      _ExtentX        =   2037
      _ExtentY        =   529
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      FontName        =   "宋体"
      FontSize        =   9
      Text            =   "00"
      SelStart        =   1
      AutoSelAll      =   -1  'True
      isNumber        =   -1  'True
      MaxLength       =   5
      afterdecimal    =   0
   End
   Begin SuperMarket.XPButton cmdExit 
      Cancel          =   -1  'True
      Height          =   345
      Left            =   5220
      TabIndex        =   3
      Top             =   5160
      Width           =   1095
      _ExtentX        =   1931
      _ExtentY        =   609
      Caption         =   "取消"
      CapAlign        =   2
      BackStyle       =   2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Mode            =   0
      Value           =   0   'False
      cBack           =   -2147483633
   End
   Begin SuperMarket.XPButton cmdOK 
      Default         =   -1  'True
      Height          =   345
      Left            =   4020
      TabIndex        =   4
      Top             =   5160
      Width           =   1095
      _ExtentX        =   1931
      _ExtentY        =   609
      Caption         =   "确定"
      CapAlign        =   2
      BackStyle       =   2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "新宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Mode            =   0
      Value           =   0   'False
      cBack           =   -2147483633
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "注:按 Delete 可以删除选中项"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   120
      TabIndex        =   7
      Top             =   5250
      Width           =   2520
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "计划进货数量:"
      Height          =   180
      Left            =   120
      TabIndex        =   6
      Top             =   4770
      Width           =   1260
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "计划进货日期:"
      Height          =   180
      Left            =   2880
      TabIndex        =   5
      Top             =   4770
      Width           =   1260
   End
End
Attribute VB_Name = "frmPlanStock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'超市销售系统
'程序开发:lc_mtt
'CSDN博客:http://blog.csdn.net/lc_mtt/
'个人主页:http://www.3lsoft.com
'邮箱:3lsoft@163.com
'注:此代码禁止用于商业用途。有修改者发我一份,谢谢!
'---------------- 开源世界,你我更进步 ----------------

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
On Error GoTo aaaa
    Dim i As Long, j As Long
    j = List1.ListItems.Count
    If j = 0 Then Exit Sub
    If MsgBox("确定添加这 " & j & " 个计划进货记录吗?", vbInformation + vbOKCancel + vbDefaultButton2) = vbCancel Then Exit Sub
    For i = 1 To List1.ListItems.Count
        cnMain.Execute "insert Stock values(" & MID$(List1.ListItems(i).Key, 2) _
            & "," & List1.ListItems(i).SubItems(1) _
            & ",NULL,NULL,'" & List1.ListItems(i).SubItems(2) _
            & "',NULL,0)"
    Next
    Unload Me
    If frmMain.cmdLeft(2).IfDraw = False Then
        frmMain.cmdLeft_Click 2
    Else
        frmStock.LoadPlanStock
    End If
Exit Sub
aaaa:
    MsgBox Err.Description, vbCritical
End Sub

Private Sub Form_Load()
    Move frmMain.Left + (frmMain.Width - Me.Width) / 2, frmMain.Top + (frmMain.Height - Me.Height) / 2
End Sub

Private Sub List1_ItemClick(ByVal Item As MSComctlLib.ListItem)
    txtNum.Text = Item.SubItems(1)
    txtDate.Text = Item.SubItems(2)
End Sub

Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo aaaa
    If KeyCode = vbKeyDelete Then
        Dim i As Long, j As Long
        j = 0
        For i = 1 To List1.ListItems.Count
            If List1.ListItems(i).Selected = True Then j = j + 1
        Next
        If j = 0 Then Exit Sub
        If MsgBox("确定删除选中的 " & j & " 个预计划进货记录吗?", vbInformation + vbOKCancel + vbDefaultButton2) = vbCancel Then Exit Sub
        For i = List1.ListItems.Count To 1 Step -1
            If List1.ListItems(i).Selected = True Then
                List1.ListItems.Remove i
            End If
        Next
        If List1.ListItems.Count = 0 Then cmdOK.Enabled = False
    End If
    If KeyCode = vbKeyA And Shift = 2 Then
        For j = 1 To List1.ListItems.Count
            List1.ListItems(j).Selected = True
        Next
    End If
Exit Sub
aaaa:
    MsgBox Err.Description, vbCritical
End Sub

Private Sub txtDate_Change()
On Error GoTo aaaa
    Dim d As Date
    d = CDate(txtDate.Text)
    List1.SelectedItem.SubItems(2) = Format(d, "yyyy-mm-dd")
aaaa:
End Sub

Private Sub txtNum_Change()
On Error GoTo aaaa
    Dim j As Long
    j = CLng(txtNum.Text)
    If j > 0 Then List1.SelectedItem.SubItems(1) = j
aaaa:
End Sub

⌨️ 快捷键说明

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