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

📄 +

📁 VB开发的ERP系统
💻
字号:
VERSION 5.00
Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
Begin VB.Form Stand_FrmGuide 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "选择导入的标准表"
   ClientHeight    =   3705
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5160
   Icon            =   "基础设置_选择导入的标准表.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3705
   ScaleWidth      =   5160
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Cmd_Cancel 
      Caption         =   "取消(&C)"
      Height          =   300
      Left            =   3915
      TabIndex        =   4
      Top             =   3315
      Width           =   1120
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确定(&O)"
      Height          =   300
      Left            =   2715
      TabIndex        =   3
      Top             =   3315
      Width           =   1120
   End
   Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
      Height          =   2670
      Left            =   105
      TabIndex        =   2
      Top             =   525
      Width           =   4935
      _ExtentX        =   8705
      _ExtentY        =   4710
      Appearance      =   1
      BorderStyle     =   1
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      MousePointer    =   0
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      BackColorFixed  =   -2147483633
      ForeColorFixed  =   -2147483630
      BackColorSel    =   -2147483635
      ForeColorSel    =   -2147483634
      BackColorBkg    =   -2147483636
      BackColorAlternate=   -2147483643
      GridColor       =   -2147483633
      GridColorFixed  =   -2147483632
      TreeColor       =   -2147483632
      FloodColor      =   192
      SheetBorder     =   -2147483642
      FocusRect       =   1
      HighLight       =   1
      AllowSelection  =   -1  'True
      AllowBigSelection=   -1  'True
      AllowUserResizing=   0
      SelectionMode   =   0
      GridLines       =   1
      GridLinesFixed  =   2
      GridLineWidth   =   1
      Rows            =   50
      Cols            =   10
      FixedRows       =   1
      FixedCols       =   1
      RowHeightMin    =   0
      RowHeightMax    =   0
      ColWidthMin     =   0
      ColWidthMax     =   0
      ExtendLastCol   =   0   'False
      FormatString    =   ""
      ScrollTrack     =   0   'False
      ScrollBars      =   3
      ScrollTips      =   0   'False
      MergeCells      =   0
      MergeCompare    =   0
      AutoResize      =   -1  'True
      AutoSizeMode    =   0
      AutoSearch      =   0
      MultiTotals     =   -1  'True
      SubtotalPosition=   1
      OutlineBar      =   0
      OutlineCol      =   0
      Ellipsis        =   0
      ExplorerBar     =   0
      PicturesOver    =   0   'False
      FillStyle       =   0
      RightToLeft     =   0   'False
      PictureType     =   0
      TabBehavior     =   0
      OwnerDraw       =   0
      Editable        =   0   'False
      ShowComboButton =   -1  'True
      WordWrap        =   0   'False
      TextStyle       =   0
      TextStyleFixed  =   0
      OleDragMode     =   0
      OleDropMode     =   0
      DataMode        =   0
      VirtualData     =   -1  'True
   End
   Begin VB.TextBox Txt_BzbName 
      Height          =   315
      Left            =   1170
      TabIndex        =   1
      Text            =   "Text1"
      ToolTipText     =   "填写新标准表的名称"
      Top             =   90
      Width           =   3885
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "标准表名称"
      Height          =   180
      Left            =   120
      TabIndex        =   0
      Top             =   150
      Width           =   900
   End
End
Attribute VB_Name = "Stand_FrmGuide"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*******************************************************
'*    模 块 名 称 :选择导入的标准表
'*    功 能 描 述 :银行代发文件的项目范围。
'*    程序员姓名  :田建秀
'*    最后修改人  :田建秀
'*    最后修改时间:2002/01/04
'*    备        注:
'*******************************************************


Dim Rec_CodeSet As New ADODB.Recordset   '编码设置表
Dim jdzygs As Integer                    '控件焦点转移个数
Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
Dim ReportTitle As String                '报表主标题
Public SortId As String
Dim Rsc As New ADODB.Recordset
Dim Sql As String
Dim I As Long
Dim BzbNO As Integer
Dim BzbName As String

'以下为固定使用变量(网格)
Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
Dim GridCode As String                   '显示网格网格代码
Dim GridInf() As Variant                 '整个网格设置信息
Dim Tsxx As String                       '系统提示信息
Dim Qslz As Long                         '网格隐藏(非操作显示)列数
Dim Sjhgd As Double                      '网格数据行高度
Dim GridBoolean() As Boolean             '网格列信息(布尔型)
Dim GridStr()  As String                 '网格列信息(字符型)
Dim GridInt() As Integer                 '网格列信息(整型)
Dim Szzls As Integer                     '数组总列数(网格列数-1)


Private Sub Cmd_Cancel_Click()
    Unload Me
End Sub

Private Sub Cmd_OK_Click()
    If CzxsGrid.Rows = CzxsGrid.FixedRows Then
        Unload Me
        Exit Sub
    End If
    If Trim(Txt_BzbName) = "" Then
        Call Xtxxts("标准表名称不能空!", 0, 1)
        Exit Sub
    End If
    If Rsc.State = 1 Then Rsc.Close
    Sql = "select * from PM_StandTbl where BzbName='" & Trim(Txt_BzbName) & "'"
    Set Rsc = Cw_DataEnvi.DataConnect.Execute(Sql)
    If Not Rsc.EOF Then
        Call Xtxxts("标准表名称不能重复!", 0, 1)
        Exit Sub
    End If
    '如果新建标准表与导入参照表的工资类别不同,则需判断新表的工资类别是否有参照表的结果项目
    With CzxsGrid
        If Trim(Stand_FrmFirst.SortId) <> Trim(.TextMatrix(.Row, 2)) Then
            If Rsc.State = 1 Then Rsc.Close
            Sql = "select * from PM_SortItem p,Rs_Items r where p.ItemID=r.ItemID " & _
                " and  FieldName='" & .TextMatrix(.Row, 1) & "' and SortID='" & _
                Stand_FrmFirst.SortId & "'"
            Set Rsc = Cw_DataEnvi.DataConnect.Execute(Sql)
            If Rsc.EOF Then
                Call Xtxxts("工资类别“" & GetComboKey(Stand_FrmFirst.ImgCbo_Sort, 1) & _
                            "”没有项目“" & Trim(.TextMatrix(.Row, Sydz("002", GridStr(), Szzls))) & "”不能导入!", 0, 1)
                Exit Sub
            End If
        End If
    End With
    '导入
    If Rsc.State = 1 Then Rsc.Close
    Set Rsc = Cw_DataEnvi.DataConnect.Execute("select * from PM_StandTbl order by BzbNO desc")
    If Not Rsc.EOF Then
        BzbNO = Rsc!BzbNO + 1
    End If
    Sql = " insert PM_StandTbl select " & BzbNO & ",'" & Stand_FrmFirst.SortId & "'" & _
          " ,'" & Trim(Txt_BzbName) & "',BzbHxItem, BzbVxItem,BzbResuItem," & _
          " BzbUnEnable,BzbConUser,BzbCond,CodeLevel from PM_StandTbl where BzbNO=" & _
          CzxsGrid.TextMatrix(CzxsGrid.Row, 0)
    Sql = Sql & " insert pm_StandTblData(BzbNO,HxData,VxData,Resudata) select " & BzbNO & ",HxData,VxData,Resudata from pm_StandTblData" & _
         " where BzbNO=" & _
          CzxsGrid.TextMatrix(CzxsGrid.Row, 0)
    On Error GoTo Err1
    With Cw_DataEnvi.DataConnect
        .BeginTrans
        .Execute Sql
        .CommitTrans
    End With
    Call Xtxxts("导入成功!", 0, 4)
    Unload Me
    Exit Sub
Err1:
    Cw_DataEnvi.DataConnect.RollbackTrans
    Call Xtxxts("导入不成功!", 0, 1)
End Sub

Private Sub CzxsGrid_click()
    With CzxsGrid
        If .Rows <> .FixedRows Then
            bName
        End If
    End With
End Sub

Private Sub Form_Load()
    '调入网格设置信息
    GridCode = "Pm_StandGuide"
    Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
    Qslz = GridInf(1)
    Sjhgd = GridInf(2)
    Szzls = CzxsGrid.Cols - 1
    Txt_BzbName = ""
    With CzxsGrid
        .TextMatrix(0, 0) = "标准表号"
        .TextMatrix(0, 1) = "结果字段名"
        .TextMatrix(0, 2) = "工资类别号"
    End With
    '填 充 网 格
    Call Cxnrtcwg
    With CzxsGrid
        If .Rows <> .FixedRows Then
            bName
        End If
    End With
End Sub
Private Sub bName()
    With Txt_BzbName
       .Text = CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))
       .SelStart = 0
       .SelLength = Len(Trim(.Text))
    End With
End Sub

Private Sub Cxnrtcwg()                               '查询内容填充网格

    Dim Sqlstr As String              '查询连接串
    Dim jsqte As Long                 '查询临时使用变量
  
    '为加快显示速度,将网格刷新动作冻结
    CzxsGrid.Redraw = False
  
    '[>>查询连接串
    Sqlstr = "SELECT * FROM PM_StandTBL where SortID<>'" & Stand_FrmFirst.SortId & "' order by BzbNO"
    '<<]
    Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
    
    With Cxnrrec
        CzxsGrid.Rows = CzxsGrid.FixedRows
        If .EOF And .BOF Then
            CzxsGrid.Redraw = True
            Exit Sub
        End If
        
        jsqte = CzxsGrid.FixedRows
        
        Do While Not .EOF
            CzxsGrid.AddItem ""
            Call Jltcwg(Cxnrrec, jsqte)                              '调入填充网格子过程
            CzxsGrid.RowHeight(jsqte) = Sjhgd                        '设置网格高度
            .MoveNext
            jsqte = jsqte + 1
        Loop
    End With
  
    '将网格刷新动作解冻
    CzxsGrid.Redraw = True
    
End Sub
Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long)           '记录内容填充网格

    '[>>以下为自定义部分
    With Jlbrec
        CzxsGrid.TextMatrix(Rowjsq, 0) = Trim(.Fields("BzbNO") & "")            '标准表号
        CzxsGrid.TextMatrix(Rowjsq, 1) = Trim(.Fields("BzbResuItem") & "")            '结果字段名
        CzxsGrid.TextMatrix(Rowjsq, 2) = Trim(.Fields("SortID") & "")            '结果字段名
        CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("BzbName") & "")            '标准表名称
               
        If Rsc.State = 1 Then Rsc.Close
        Set Rsc = Cw_DataEnvi.DataConnect.Execute("select * from Rs_Items where FieldName='" & Trim(.Fields("BzbResuItem") & "") & "'")
        If Not Rsc.EOF Then
            CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(Rsc!ChName)            '结果项目
        End If
        
    End With
    '以上为自定义部分<<]
    
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set Rsc = Nothing
End Sub

Private Sub Txt_BzbName_KeyPress(KeyAscii As Integer)
    If Len(Txt_BzbName) = 30 Then
        KeyAscii = 0
    End If
End Sub

⌨️ 快捷键说明

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