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

📄 frmxzda.frm

📁 储存系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   15
               Left            =   0
               TabIndex        =   29
               Top             =   4200
               Width           =   975
            End
            Begin VB.Label Label1 
               Caption         =   "包装数量"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   9
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   11
               Left            =   0
               TabIndex        =   28
               Top             =   3720
               Width           =   735
            End
            Begin VB.Label Label1 
               Caption         =   "进货价格"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   9
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   10
               Left            =   0
               TabIndex        =   27
               Top             =   3240
               Width           =   735
            End
            Begin VB.Label Label1 
               Caption         =   "销售价格"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   9
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   7
               Left            =   0
               TabIndex        =   26
               Top             =   2760
               Width           =   735
            End
            Begin VB.Label Label1 
               Caption         =   "商品单位"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   9
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   4
               Left            =   0
               TabIndex        =   25
               Top             =   2280
               Width           =   855
            End
            Begin VB.Label Label1 
               Caption         =   "商品规格"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   9
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   3
               Left            =   0
               TabIndex        =   24
               Top             =   1800
               Width           =   855
            End
            Begin VB.Label Label1 
               Caption         =   "商品型号"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   9
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   2
               Left            =   0
               TabIndex        =   23
               Top             =   1320
               Width           =   855
            End
            Begin VB.Label Label1 
               Caption         =   "商品全名"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   9
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   1
               Left            =   0
               TabIndex        =   22
               Top             =   840
               Width           =   855
            End
            Begin VB.Label Label1 
               Caption         =   "商品类型"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   9
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   0
               Left            =   0
               TabIndex        =   21
               Top             =   360
               Width           =   855
            End
         End
      End
      Begin MSComDlg.CommonDialog CommonDialog1 
         Left            =   8760
         Top             =   -120
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
         DialogTitle     =   "选择照片"
         Filter          =   "图片文件(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF"
      End
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   570
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   11280
      _ExtentX        =   19897
      _ExtentY        =   1005
      ButtonWidth     =   873
      ButtonHeight    =   953
      Appearance      =   1
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   7
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "新增"
            Key             =   "tolXZ"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "修改"
            Key             =   "tolXG"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "保存"
            Key             =   "tolBC"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "删除"
            Key             =   "tolSC"
            ImageIndex      =   4
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "退出"
            Key             =   "tolTC"
            ImageIndex      =   6
         EndProperty
      EndProperty
      BorderStyle     =   1
   End
End
Attribute VB_Name = "frmXZDA"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim phoPath As String '照片路径
Dim SQL As String
Private Sub cmdADDPHO_Click() '选择照片过程
Dim yPath As String '文件源路径
Dim newPath As String '新文件路径

If Me.Text1(0).Text = "" Or Me.Text1(1).Text = "" Then
   MsgBox "请先录入商品类型、商品全名然后再选择照片!", 64, "提示"
   Exit Sub
End If

On erron GoTo Errline
    Me.CommonDialog1.ShowOpen
    yPath = Me.CommonDialog1.FileName
        If yPath <> "" Then
           newPath = App.Path & "\photos\" & Me.Text1(0).Text & Me.Text1(1).Text & ".jpg"
           FileCopy yPath, newPath
           Me.Image1.Picture = LoadPicture(newPath)
           phoPath = "\photos\" & Me.Text1(0).Text & Me.Text1(1).Text & ".jpg"
        End If
    Exit Sub
Errline:
    MsgBox "操作失败!", 48, "错误"
End Sub



Private Sub cmdDELPHO_Click()
Me.Image1.Picture = LoadPicture(App.Path & "\bg\000.jpg")
phoPath = ""
End Sub

Private Sub Combo1_Click() 'text1赋值
Me.Text1(tFlag).Text = Me.Combo1.Text
Me.Combo1.Visible = False
Me.Text1(tFlag + 1).SetFocus
End Sub

Private Sub Form_Initialize()
Call InitCommonControls 'XP效果
End Sub
Private Sub Form_Load()
If newFlag <> 0 Then '如果为修改
    Call OpenConn
    SQL = "select * from 基础数据表 where sjid=" & gXhcd
    rs.Open SQL, cn, 1, 1
    For i = 0 To 13
        Me.Text1(i).Text = rs.Fields(i + 1) & ""
    Next
    Me.Text1(13).Text = rs!建档人 & ""

    '像片路径---------------
    If rs!像片 <> "" Then
        If Dir(App.Path & rs!像片) <> "" Then '判断像片是否存在
            Me.Image1.Picture = LoadPicture(App.Path & rs!像片)
            phoPath = rs!像片
        End If
    Else
        Me.Image1.Picture = LoadPicture(App.Path & "\bg\000.jpg")
        phoPath = ""
    End If
    '------------------------
    Call CloseConn
    Me.Toolbar1.Buttons(1).Visible = False '新增按钮不可用
    Me.Toolbar1.Buttons(3).Enabled = False
    Me.Toolbar1.Buttons(4).Enabled = False
Else '如果为新增
    Me.Text1(13).Text = gCzy
    Me.Toolbar1.Buttons(2).Visible = False '新增按钮不可用
    Me.Toolbar1.Buttons(3).Enabled = False
    Me.Toolbar1.Buttons(4).Visible = False
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
If sx = True Then
    frmWNCX.cmdSSSSSSX = True '刷新frmWNCX的listview
    sx = False
End If
gXhcd = 0
End Sub



Private Sub Image1_DblClick()
If phoPath <> "" Then '双击以后用IE打开像片
    Shell "explorer.exe " & App.Path & phoPath & "", vbNormalFocus
End If
End Sub

Private Sub lvwJTCY_BeforeLabelEdit(Cancel As Integer)

End Sub

Private Sub lvwGRJL_BeforeLabelEdit(Cancel As Integer)

End Sub




Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) '按钮组
Select Case Button.Key
    Case Is = "tolXZ" '新增按钮
        Me.Frame1.Enabled = True
        For i = 0 To 13
            Me.Text1(i).Text = ""
        Next
        Me.Image1.Picture = LoadPicture(App.Path & "\bg\000.jpg")
        Me.Toolbar1.Buttons(1).Enabled = False '点击新增按钮后
        Me.Toolbar1.Buttons(3).Enabled = True
        
    Case Is = "tolXG" '修改按钮
        Me.Frame1.Enabled = True
        Me.Toolbar1.Buttons(2).Enabled = False
        Me.Toolbar1.Buttons(3).Enabled = True
        Me.Toolbar1.Buttons(4).Enabled = True
    
    Case Is = "tolBC" '保存按钮
        If Me.Text1(0).Text = "" Then
            Exit Sub
        End If
       If newFlag = 0 Then '如果是新记录
            Call OpenConn
            SQL = "select * from 基础数据表"
            rs.Open SQL, cn, 3, 3
            rs.AddNew
                For i = 0 To 13
                    rs.Fields(i + 1) = Me.Text1(i).Text
                Next
                rs!建档人 = Me.Text1(13).Text
                rs!像片 = phoPath
            rs.Update
            Call CloseConn
            phoPath = "" '清空像片路径
            Me.Frame1.Enabled = False
            MsgBox "记录添加成功!", 64, "提示"
            Me.Toolbar1.Buttons(1).Enabled = True
            Me.Toolbar1.Buttons(3).Enabled = False
        Else '如果是修改记录
             Call OpenConn
            SQL = "select * from 基础数据表 where sjid=" & gXhcd
            rs.Open SQL, cn, 3, 3
                For i = 0 To 13
                    rs.Fields(i + 1) = Me.Text1(i).Text
                Next
                rs!建档人 = gCzy
                rs!像片 = phoPath
            rs.Update
            Call CloseConn
            Me.Frame1.Enabled = False
            MsgBox "记录更新成功!", 64, "提示"
            Me.Toolbar1.Buttons(2).Enabled = True
            Me.Toolbar1.Buttons(3).Enabled = False
            Me.Toolbar1.Buttons(4).Enabled = False
        End If
    Case Is = "tolSC" '删除按钮
        msg = MsgBox("是否要删除该记录?", vbYesNo + 64, "提示")
        If msg = vbYes Then
            Call OpenConn
            cn.Execute ("delete * from 基础数据表 where sjid=" & gXhcd)
            Call CloseConn
            MsgBox "记录删除成功!", 64, "提示"
            Unload Me
        End If
    Case Is = "tolTC" '退出按钮
        Unload Me
End Select
End Sub



       

⌨️ 快捷键说明

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