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

📄 frmwatermeterinsteadinput.frm

📁 自来水公司的一个管理系统
💻 FRM
📖 第 1 页 / 共 4 页
字号:
         Left            =   4620
         TabIndex        =   40
         Top             =   945
         Width           =   330
      End
      Begin VB.Label Label10 
         Caption         =   "用户名称"
         Height          =   255
         Left            =   195
         TabIndex        =   39
         Top             =   300
         Width           =   765
      End
      Begin VB.Label Label9 
         Caption         =   "用户用水地址"
         Height          =   255
         Left            =   195
         TabIndex        =   38
         Top             =   615
         Width           =   1140
      End
      Begin VB.Label Label5 
         Caption         =   "所属小区"
         Height          =   255
         Left            =   7065
         TabIndex        =   37
         Top             =   300
         Width           =   780
      End
      Begin VB.Label Label2 
         Caption         =   "所属片区"
         Height          =   255
         Left            =   4575
         TabIndex        =   36
         Top             =   300
         Width           =   750
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "报修"
      ForeColor       =   &H8000000D&
      Height          =   630
      Left            =   120
      TabIndex        =   31
      Top             =   555
      Width           =   9615
      Begin MSMask.MaskEdBox txtUID 
         Height          =   300
         Left            =   5790
         TabIndex        =   3
         Top             =   195
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   529
         _Version        =   393216
         MaxLength       =   5
         Mask            =   "99999"
         PromptChar      =   " "
      End
      Begin MSComCtl2.DTPicker dtpReportDate 
         Height          =   300
         Left            =   990
         TabIndex        =   1
         Top             =   195
         Width           =   1425
         _ExtentX        =   2514
         _ExtentY        =   529
         _Version        =   393216
         Format          =   23724033
         CurrentDate     =   37051
      End
      Begin VB.TextBox txtReportMan 
         Height          =   300
         Left            =   3210
         MaxLength       =   8
         TabIndex        =   2
         Top             =   195
         Width           =   1365
      End
      Begin VB.Label Label3 
         Caption         =   "用户顺序号"
         Height          =   255
         Left            =   4800
         TabIndex        =   34
         Top             =   240
         Width           =   960
      End
      Begin VB.Label Label1 
         Caption         =   "报修人"
         Height          =   255
         Index           =   0
         Left            =   2625
         TabIndex        =   33
         Top             =   240
         Width           =   615
      End
      Begin VB.Label Label4 
         Caption         =   "报修时间"
         Height          =   255
         Left            =   210
         TabIndex        =   32
         Top             =   240
         Width           =   765
      End
   End
   Begin VB.PictureBox pbBottomBox 
      Height          =   600
      Left            =   0
      ScaleHeight     =   540
      ScaleWidth      =   9885
      TabIndex        =   26
      Top             =   5385
      Width           =   9945
      Begin VB.CommandButton cmdCommandArray3 
         Caption         =   ">>"
         Height          =   345
         Index           =   3
         Left            =   6345
         TabIndex        =   30
         Top             =   90
         Width           =   885
      End
      Begin VB.CommandButton cmdCommandArray3 
         Caption         =   ">"
         Height          =   345
         Index           =   2
         Left            =   5475
         TabIndex        =   29
         Top             =   90
         Width           =   885
      End
      Begin VB.CommandButton cmdCommandArray3 
         Caption         =   "<"
         Height          =   345
         Index           =   1
         Left            =   4605
         TabIndex        =   28
         Top             =   90
         Width           =   885
      End
      Begin VB.CommandButton cmdCommandArray3 
         Caption         =   "<<"
         Height          =   345
         Index           =   0
         Left            =   3735
         TabIndex        =   27
         Top             =   90
         Width           =   885
      End
      Begin VB.CommandButton cmdCommandArray2 
         Caption         =   "放弃"
         Height          =   345
         Index           =   1
         Left            =   2760
         TabIndex        =   25
         Top             =   90
         Width           =   885
      End
      Begin VB.CommandButton cmdCommandArray2 
         Caption         =   "保存"
         Height          =   345
         Index           =   0
         Left            =   1890
         TabIndex        =   24
         Top             =   90
         Width           =   885
      End
      Begin VB.CommandButton cmdCommandArray1 
         Caption         =   "编辑"
         Height          =   345
         Index           =   1
         Left            =   885
         TabIndex        =   23
         Top             =   90
         Width           =   885
      End
      Begin VB.CommandButton cmdCommandArray1 
         Caption         =   "输入"
         Height          =   345
         Index           =   0
         Left            =   15
         TabIndex        =   22
         Top             =   90
         Width           =   885
      End
   End
   Begin VB.Label Label22 
      Caption         =   "维修单编号:"
      Height          =   255
      Left            =   7185
      TabIndex        =   55
      Top             =   285
      Width           =   1080
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000005&
      Index           =   0
      X1              =   60
      X2              =   9885
      Y1              =   5310
      Y2              =   5310
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000003&
      Index           =   1
      X1              =   60
      X2              =   9900
      Y1              =   5295
      Y2              =   5295
   End
End
Attribute VB_Name = "frmWaterMeterInsteadInput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim adoUWmInsteadRS As ADODB.Recordset

Dim bytCommandFlag As Byte  '用于记录第一组按钮的状态,这样,在第二组的保存,放弃按钮中
                            '就可知道是原来是按的新增还是编辑,从而采取不同的处理方法
Dim strCurJFYm As String    '当前所处的计费年月(由计费记录表来判断)

'---------------------------------------------------
'按钮事件
'---------------------------------------------------
Private Sub cmdCommandArray1_Click(Index As Integer)
    Dim strFixID As String
    
    bytCommandFlag = Index
    Select Case Index
        Case 0  '输入
            strFixID = Trim(GetMaxFixID())
            If strFixID = "" Then
                Warning "得到维修单编号出错!!!"
                Exit Sub
            End If
            
            Call DisableCMD1
            Call EnableCMD2
            Call DisableCMD3
            
            Call InitInterface
            Call EnableInterface
            Me.txtFixID.Text = strFixID
            Me.dtpReportDate.SetFocus
        
        Case 1  '编辑
            If Trim(Me.txtFixID.Text) = "" Then Exit Sub
            
            Call DisableCMD1
            Call EnableCMD2
            Call DisableCMD3
            
            Call EnableInterface
            Me.txtFixID.Enabled = False '注意:编辑时只能对该编号用户的维修内容进行编辑
            Me.txtNewWmID.Enabled = False   '注意:编辑时不允许编辑新水表编号(原因和不能删除一样)
            Me.dtpReportDate.SetFocus
        
'对于更换操作由于牵扯到用户档案的修改,因此不能删除(如果删除将带来一系列的问题),如果确实要“删除”,只能再次更换
'        Case 2  '删除
'            Dim bytReturnFlag As Byte '用于接收msgbox
'
'            If Trim(Me.txtFixID.Text) = "" Then Exit Sub
'            If adoUWmInsteadRS.EOF Or adoUWmInsteadRS.BOF Then Exit Sub
'
'            bytReturnFlag = MsgBox("确定要删除该用户的水表更换记录吗?", vbYesNo + vbInformation + vbDefaultButton2, "提示信息")
'            If bytReturnFlag = vbNo Then Exit Sub
'
'            '删除该记录,清屏
'            adoUWmInsteadRS.Delete
'            On Error Resume Next
'            adoUWmInsteadRS.MoveNext
'            If adoUWmInsteadRS.EOF Then adoUWmInsteadRS.MovePrevious
'            On Error GoTo 0
'            Call DisplayCurrentData
'            Call InitCommandBox
'
        Case Else
            MsgBox "按扭功能未定义", vbOKOnly + vbExclamation, "警告"
    End Select

End Sub

Private Sub cmdCommandArray2_Click(Index As Integer)
    Dim bytReturnFlag As Byte '用于接收msgbox
    
    Select Case Index
        Case 0  '保存
            '检测关键数据是否填写
            If Trim(Me.txtUID.Text) = "" Then
                Warning "用户编号没有输入!!!"
                Me.txtUID.SetFocus
                Exit Sub
            End If
            If Trim(Me.txtNewWmID.Text) = "" Then
                Warning "新水表编号没有输入!!!"
                Me.txtNewWmID.SetFocus
                Exit Sub
            End If
            
            '保存提示
            bytReturnFlag = MsgBox("请仔细核对更换前、更换后水表读数以及所属计费时段" & Chr(13) & Chr(13) & "这些数据将直接影响水费的计费操作!!!", vbYesNoCancel + vbInformation + vbDefaultButton1, "提示信息")
            If bytReturnFlag = vbNo Then            '不保存
                Call DisplayCurrentData
            ElseIf bytReturnFlag = vbCancel Then    '从试
                Exit Sub
            ElseIf bytReturnFlag = vbYes Then       '保存数据
                Call SaveCurrenData
            End If
            Call DisableInterface
            Call InitCommandBox
                   
        Case 1  '放弃
            Call DisplayCurrentData
            Call DisableInterface
            Call InitCommandBox
    
        Case Else
            MsgBox "按扭功能未定义", vbOKOnly + vbExclamation, "警告"
    End Select

End Sub

Private Sub cmdCommandArray3_Click(Index As Integer)
    Select Case Index
        Case 0  '<<
            If adoUWmInsteadRS.BOF Then         '记录集为空的情况
                'Warning "已经处于首记录!"
                Beep
                Exit Sub
            End If
            
            adoUWmInsteadRS.MovePrevious        '如果已经是首条的情况,Beep
            If adoUWmInsteadRS.BOF Then
                adoUWmInsteadRS.MoveNext
                Beep
                Exit Sub
            End If
            
            adoUWmInsteadRS.MoveFirst           '正常情况
            Call DisplayCurrentData
        
        Case 1  '<
            If adoUWmInsteadRS.BOF Then
                'Warning "已经处于首记录!"
                Beep
                Exit Sub
            End If
            adoUWmInsteadRS.MovePrevious
            If adoUWmInsteadRS.BOF Then
                adoUWmInsteadRS.MoveNext
                Beep
            Else
                Call DisplayCurrentData
            End If
        
        Case 2  '>
            If adoUWmInsteadRS.EOF Then
                'Warning "已经处于尾记录!"
                Beep
                Exit Sub
            End If
            adoUWmInsteadRS.MoveNext
            If adoUWmInsteadRS.EOF Then
                adoUWmInsteadRS.MovePrevious
                Beep
            Else
                Call DisplayCurrentData
            End If
        
        Case 3  '>>
            If adoUWmInsteadRS.EOF Then         '记录集为空的情况
                'Warning "已经处于尾记录!"
                Beep
                Exit Sub
            End If
            
            adoUWmInsteadRS.MoveNext            '如果已经是尾条的情况,Beep
            If adoUWmInsteadRS.EOF Then
                adoUWmInsteadRS.MovePrevious
                Beep
                Exit Sub
            End If
            
            adoUWmInsteadRS.MoveLast            '正常情况
            Call DisplayCurrentData

⌨️ 快捷键说明

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