当前位置:跳过导航链接计算机毕业设计首页 : VB计算机毕业设计 : 详细内容

VB住房信息管理系统(程序下载)(10)

来源:xiaoniu168.com 作者:本站原创 添加时间:2014-11-06 点击数:41941

计算机毕业设计介绍:

4.5 居民区信息列表页面
点击基础资料维护里的居民区信息维护或点击界面的快捷按钮居民区维护,显示居民区信息维护列表页面。

以下是引用片段:

实现功能的关键代码为:
Private Sub Form_Activate()
If Me.Tag = "tmp" Then
   Me.Tag = ""
   Exit Sub
End If
If Me.txtID.Enabled = True Then
   '新住房
   Me.txtsshz.Text = ""
   Me.txtssjmq.Text = ""
   Me.txtsssq.Text = ""
   Me.txtbz.Text = ""
   Me.txtjzmj.Text = ""
   Me.txtcsjg.Text = ""
   Me.txtczjg.Text = ""
   Me.Combocx.ListIndex = 0
   Me.Combohx.ListIndex = 0
   Me.Combofcxz.ListIndex = 0
   Me.DTPickerjcsj.Value = Format(Date, "yyyy-mm-dd")
Else
   '已经存在的住房  根据传递的标志 查询并显示内容
   Dim tmprs As New ADODB.Recordset
   Set tmprs = ExecSql("select * from zfxx, hzxx, jmqxx, sqxx where zfxx.sssq=sqxx.sqdm and zfxx.ssjmq=jmqxx.jmqdm and zfxx.sshz= hzxx.hzdm and zfdm='" & Me.txtID.Text & "'")
   With tmprs
       If .RecordCount > 0 Then
          Me.txtsshz.Text = .Fields("hzxm").Value
          Me.txtsshz.Tag = .Fields("sshz").Value
          Me.txtssjmq.Text = .Fields("jmqmc").Value
          Me.txtssjmq.Tag = .Fields("ssjmq").Value
          Me.txtsssq.Text = .Fields("sqmc").Value
          Me.txtsssq.Tag = .Fields("sssq").Value
          Me.txtjzmj.Text = .Fields("zfjzmj").Value
          Me.Chkifcs.Value = .Fields("ifxs").Value
          Me.txtcsjg.Text = .Fields("xsjg").Value
          Me.Chkcz.Value = .Fields("czbz").Value
          Me.txtczjg.Text = .Fields("czjg").Value
          Me.txtbz.Text = .Fields("bz").Value
          Me.DTPickerjcsj.Value = .Fields("jcsj").Value
          Me.Combocx.ListIndex = GetComboIndex(Me.Combocx, Trim(.Fields("cx").Value))
          Me.Combohx.ListIndex = GetComboIndex(Me.Combohx, Trim(.Fields("hx").Value))
          Me.Combofcxz.ListIndex = GetComboIndex(Me.Combofcxz, Trim(.Fields("fcxz").Value))
       End If
   End With

End If
End Sub

Private Sub MMButton_XPBE2_Click()
Dim strresult As String

If Me.txtID.Enabled = True Then
   '添加住房信息
   If Me.txtID.Text = "" Or Me.txtssjmq.Text = "" Or Me.txtsssq.Text = "" Then
      MsgBox "住房代码或所属社区或所属居民区不能为空"
      Exit Sub
   End If
   If ExecSql("select * from zfxx where zfdm='" & Trim(Me.txtID.Text) & "'").RecordCount > 0 Then
      MsgBox "住房代码重复,不能保存!"
      Exit Sub
   End If
   strresult = Exec_SqL("insert into zfxx(zfdm, sshz, ssjmq, sssq, zfjzmj, jcsj, ifxs, xsjg, czbz, czjg, cx, hx, fcxz, bz) " _
      & " values('" & Trim(Me.txtID.Text) & "','" & Trim(Me.txtsshz.Tag) & "','" & Trim(Me.txtssjmq.Tag) & "','" & Trim(Me.txtsssq.Tag) & "'," _
      & Val(Me.txtjzmj.Text) & ",'" & Me.DTPickerjcsj.Value & "'," & Me.Chkifcs.Value & "," & Val(Me.txtcsjg.Text) & "," & Me.Chkcz.Value & "," & Val(Me.txtczjg.Text) & ",'" _
      & Trim(Me.Combocx.Text) & "','" & Trim(Me.Combohx.Text) & "','" & Trim(Me.Combofcxz.Text) & "','" & Me.txtbz.Text & "')")
   If strresult <> "OK" Then
      MsgBox strresult
      Exit Sub
   End If
   Call frmZFWH.UpdateList
Else
   '修改住房信息
   If Me.txtssjmq.Text = "" Then
      MsgBox "所属社区或所属居民区不能为空"
      Exit Sub
   End If
   strresult = Exec_SqL("update zfxx set sshz='" & Trim(Me.txtsshz.Tag) & "'," _
   & " ssjmq ='" & Trim(Me.txtssjmq.Tag) & "', " _
   & " sssq ='" & Trim(Me.txtsssq.Tag) & "', " _
   & " zfjzmj =" & Trim(Me.txtjzmj.Text) & ", " _
   & " jcsj ='" & Me.DTPickerjcsj.Value & "', " _
   & " ifxs =" & Me.Chkifcs.Value & ", " _
   & " xsjg =" & Val(Me.txtcsjg.Text) & ", " _
   & " czbz =" & Me.Chkcz.Value & ", " _
   & " czjg =" & Val(Me.txtczjg.Text) & ", " _
   & " cx ='" & Trim(Me.Combocx.Text) & "', " _
   & " hx ='" & Trim(Me.Combohx.Text) & "', " _
   & " fcxz ='" & Trim(Me.Combofcxz.Text) & "', " _
   & " bz ='" & Me.txtbz.Text & "' where " _
   & " zfdm   ='" & Trim(Me.txtID.Text) & "'")
   If strresult <> "OK" Then
      MsgBox strresult
      Exit Sub
   End If
   Call frmZFWH.UpdateList
End If
log = InsertOperateLog("编辑住房信息", "成功")
Unload Me
End Sub

〖资料来源:计算机毕业论文 www.xiaoniu168.com

第11页为计算机毕业论文部分......

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网
计算机毕业设计客服
计算机毕业论文客服在线 计算机毕业论文客服在线
计算机毕业论文在线,计算机毕业设计在线