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

📄 水费管理.frm

📁 小区物业管理系统vb开发的,曾用于本科毕业设计
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   7
      BeginProperty Column00 
         DataField       =   "大楼名称"
         Caption         =   "大楼名称"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   "房号"
         Caption         =   "房号"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02 
         DataField       =   "前月抄表日期"
         Caption         =   "前月抄表日期"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column03 
         DataField       =   "前月抄表数据"
         Caption         =   "前月抄表数据"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column04 
         DataField       =   "本月抄表日期"
         Caption         =   "本月抄表日期"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column05 
         DataField       =   "本月抄表数据"
         Caption         =   "本月抄表数据"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column06 
         DataField       =   "实际用水量"
         Caption         =   "实际用水量"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            ColumnWidth     =   854.929
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   524.976
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   1244.976
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   1365.165
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   1275.024
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   1365.165
         EndProperty
         BeginProperty Column06 
            ColumnWidth     =   1365.165
         EndProperty
      EndProperty
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0FFC0&
      Caption         =   "信息"
      Height          =   975
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   8295
      Begin VB.ComboBox Cmbroom 
         DataField       =   "房号"
         DataSource      =   "Adodc1"
         Enabled         =   0   'False
         Height          =   300
         Left            =   3720
         TabIndex        =   28
         Top             =   360
         Width           =   1575
      End
      Begin VB.ComboBox Combo2 
         DataField       =   "仪表名称"
         DataSource      =   "Adodc1"
         Enabled         =   0   'False
         Height          =   300
         ItemData        =   "水费管理.frx":81C3
         Left            =   6720
         List            =   "水费管理.frx":81CA
         TabIndex        =   6
         Top             =   360
         Width           =   1455
      End
      Begin VB.ComboBox Combo1 
         DataField       =   "大楼名称"
         DataSource      =   "Adodc1"
         Enabled         =   0   'False
         Height          =   300
         ItemData        =   "水费管理.frx":81D4
         Left            =   960
         List            =   "水费管理.frx":81E1
         TabIndex        =   3
         Top             =   360
         Width           =   1575
      End
      Begin VB.Label Label3 
         BackColor       =   &H00C0FFC0&
         Caption         =   "仪表名称:"
         Height          =   255
         Left            =   5880
         TabIndex        =   5
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label2 
         BackColor       =   &H00C0FFC0&
         Caption         =   "房号:"
         Height          =   255
         Left            =   3240
         TabIndex        =   4
         Top             =   360
         Width           =   495
      End
      Begin VB.Label Label1 
         BackColor       =   &H00C0FFC0&
         Caption         =   "大楼名称:"
         Height          =   255
         Left            =   120
         TabIndex        =   2
         Top             =   360
         Width           =   855
      End
   End
End
Attribute VB_Name = "水费管理"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim objcn As Connection
Dim objhome As Recordset
Dim objwater As Recordset
Dim isadding As Boolean
'添加记录状态
Private Sub Cmdadd_Click()
Cmbroom.Clear
If isadding = False Then
   Adodc1.Caption = "添加新记录"
   isadding = True
   Adodc1.Recordset.AddNew
   Combo1.Enabled = True
   Cmbroom.Enabled = True
   Combo2.Enabled = True
   DTP1.Enabled = True
   Text3.Enabled = True
   DTP2.Enabled = True
   Text5.Enabled = True
   Text6.Enabled = True
   Cmdsave.Visible = True
Else
   MsgBox "已处于添加状态" & vbCrLf & "请添加记录!", vbInformation, "温馨提示"
End If
End Sub

Private Sub Cmddelect_Click()
If isadding = True Then
MsgBox "当前状态为添加记录,不能删除记录", , "温馨提示"
Adodc1.Recordset.CancelBatch
'Adodc1.Recordset.Requery
Else
    If MsgBox("是否要删除当前记录?", vbYesNo + vbQuestion, "温馨提示") = vbYes Then
     Adodc1.Recordset.Delete
     Adodc1.Recordset.Requery
  End If
End If
End Sub

Private Sub Cmdexit_Click()
物业管理系统.Show
Unload Me
End Sub

'保存用电信息
Private Sub Cmdsave_Click()
If isadding = False Then
   MsgBox "此状态不允许添加记录!", vbCritical, "温馨提示"
   Exit Sub
End If
If Trim(Combo1.Text) = "" Or Trim(Cmbroom.Text) = "" Then
    MsgBox "请输入数据!", vbInformation, "温馨提示"
Else
  With objwater
  If .RecordCount > 0 Then
     .MoveFirst
     .Find "房号='" & Trim(Cmbroom.Text) & "'"
     If Not .EOF Then
        If Trim(Cmbroom.Text) = Trim(.Fields("房号")) Then
           MsgBox "此用户数据已记录!", vbInformation, "温馨提示"
           Adodc1.Recordset.CancelBatch
         End If
     Else
           If isadding Then
              .AddNew
              .Fields("大楼名称") = Trim(Combo1.Text)
              .Fields("房号") = Trim(Cmbroom.Text)
              .Fields("仪表名称") = Trim(Combo2.Text)
              .Fields("前月抄表日期") = Trim(DTP1.Value)
              .Fields("前月抄表数据") = Trim(Text3.Text)
              .Fields("本月抄表日期") = Trim(DTP2.Value)
              .Fields("本月抄表数据") = Trim(Text5.Text)
              .Fields("实际用水量") = Trim(Text6.Text)
              .Update
               MsgBox "录入数据成功!", , "温馨提示"
              isadding = False
            End If
      End If
    Combo1.Enabled = False
    Cmbroom.Enabled = False
    Combo2.Enabled = False
    DTP1.Enabled = False             '前月抄表日期
    Text3.Enabled = False
    DTP2.Enabled = False             '本月抄表日期
    Text5.Enabled = False
    Text6.Enabled = False

    Adodc1.Refresh
    Adodc1.Caption = "当前记录:" & Adodc1.Recordset.AbsolutePosition & "/" & Adodc1.Recordset.RecordCount
 
   End If
 End With
End If
End Sub

Private Sub Combo1_Click()
'获取楼房区信息
 Set objhome = New Recordset
 With objhome
      Set .ActiveConnection = objcn
          .CursorLocation = adUseClient
          .CursorType = adOpenStatic
          .LockType = adLockOptimistic
          .Open "select * from " & Trim(Combo1.Text)
          'Set .ActiveConnection = Nothing                  '断开数据库联接
End With
With objhome
     If .RecordCount > 0 Then
        .MoveFirst
        While Not .EOF
              Cmbroom.AddItem .Fields("房号")
              .MoveNext
        Wend
     End If
End With
'获取水费信息数据
    Set objwater = New Recordset
    With objwater
         Set .ActiveConnection = objcn
             .CursorLocation = adUseClient
             .CursorType = adOpenStatic
             .LockType = adLockOptimistic
             .Open "select * from 水表信息 where 大楼名称='" & Trim(Combo1.Text) & "'"  '获取某栋大楼信息
    End With
End Sub

'计算容量
Private Sub Command1_Click()
If Text3.Text = "" Or Text5.Text = "" Then
   MsgBox "请输入用电量", vbInformation, "温馨提示"
   Text3.SetFocus
Else
   If CInt(CInt(Text5) < CInt(Text3)) Then
      MsgBox "数据输入有误" & vbCrLf & "请重新输入", vbCritical, "温馨提示"
      Text3.Text = ""
      Text5.Text = ""
      Text3.SetFocus
    Else
      Text6 = CInt(CInt(Text5) - CInt(Text3))
    End If
End If
End Sub
'返回主窗体
Private Sub Cmdback_Click()

End Sub

'放弃添加记录
Private Sub Command2_Click()
If MsgBox("是否放弃添加记录?", vbYesNo + vbQuestion, "温馨提示") = vbYes Then
   isadding = False
   Adodc1.Recordset.CancelBatch                   '恢复到更改以前的操作
   Adodc1.Recordset.Requery                       '回到第一条记录状态
   Adodc1.Caption = "当前记录:" & Adodc1.Recordset.AbsolutePosition & "/" & Adodc1.Recordset.RecordCount
   Combo1.Enabled = False
   Combo2.Enabled = False
   Cmbroom.Enabled = False
   DTP1.Enabled = False
   DTP2.Enabled = False
   Text3.Enabled = False
   Text5.Enabled = False
   Text6.Enabled = False
End If
End Sub

Private Sub Form_Load()
 '建立数据库联接
    Set objcn = New Connection                 '实例化联接对象
    With objcn                                 '建立数据库联接
        .Provider = "SQLOLEDB"
        .ConnectionString = "User ID=sa;PWD=sa;Data Source=(local);" & _
                            "Initial Catalog=物业管理系统"
        .Open
    End With

 Adodc1.Caption = "当前记录:" & Adodc1.Recordset.AbsolutePosition & "/" & Adodc1.Recordset.RecordCount

End Sub

⌨️ 快捷键说明

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