📄 frm_fwtj.frm
字号:
TabIndex = 21
Text = "Combo2"
Top = 240
Width = 1575
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1080
TabIndex = 1
Top = 260
Width = 1695
End
Begin VB.Label Label5
Caption = "楼层"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 5640
TabIndex = 16
Top = 315
Width = 495
End
Begin VB.Label Label4
Caption = "楼房名称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3000
TabIndex = 15
Top = 320
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "楼盘名称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 2
Top = 315
Width = 975
End
End
End
Attribute VB_Name = "frm_FWTJ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim aa, gg, a, tep1, tep2
Public adoCon As New ADODB.Connection
Public adoRs As New ADODB.Recordset
Private Sub Combo1_Click()
Combo2.SetFocus
End Sub
Private Sub Combo2_Click()
Combo3.SetFocus
End Sub
Private Sub Command1_Click()
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=ljm"
If a = 1 Then '上浮金额
Adodc1.RecordSource = "select * from Table_FWXX where 楼盘名称='" + Combo1.Text + "' and 楼房名称='" + Combo2.Text + "' and 楼层='" + Combo3.Text + "' and 状态='未销售'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
aa = Val(Adodc1.Recordset.Fields("销售单价")) + Val(Text1.Text)
gg = Val(aa) * Val(Adodc1.Recordset.Fields("房屋销售面积"))
Set adoRs = adoCon.Execute("UPDATE Table_FWXX SET 销售单价= '" + Str(aa) + "',房产总价= '" + Str(gg) + "' where 楼盘名称='" + Combo1.Text + "' and 楼房名称='" + Combo2.Text + "' and 楼层='" + Combo3.Text + "' and 状态='未销售'")
MsgBox "调价成功!!", 32, "房地产销售管理系统"
Else
Text1.Text = ""
Text2.Text = ""
Text5.Text = ""
Text6.Text = ""
MsgBox "对不起,没有符合条件的房屋!!", 32, "房地产销售管理系统"
End If
ElseIf a = 2 Then '下调金额
Adodc1.RecordSource = "select * from Table_FWXX where 楼盘名称='" + Combo1.Text + "' and 楼房名称='" + Combo2.Text + "' and 楼层='" + Combo3.Text + "' and 状态='未销售'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
aa = Val(Adodc1.Recordset.Fields("销售单价")) - Val(Text5.Text)
gg = Val(aa) * Val(Adodc1.Recordset.Fields("房屋销售面积"))
Set adoRs = adoCon.Execute("UPDATE Table_FWXX SET 销售单价= '" + Str(aa) + "',房产总价= '" + Str(gg) + "' where 楼盘名称='" + Combo1.Text + "' and 楼房名称='" + Combo2.Text + "' and 楼层='" + Combo3.Text + "' and 状态='未销售'")
MsgBox "调价成功!!", 32, "房地产销售管理系统"
Else
MsgBox "对不起,没有符合条件的房屋!!", 32, "房地产销售管理系统"
Text1.Text = ""
Text2.Text = ""
Text5.Text = ""
Text6.Text = ""
End If
ElseIf a = 3 Then '上浮的百分比
Adodc1.RecordSource = "select * from Table_FWXX where 楼盘名称='" + Combo1.Text + "' and 楼房名称='" + Combo2.Text + "' and 楼层='" + Combo3.Text + "' and 状态='未销售'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
aa = Val(Adodc1.Recordset.Fields("销售单价")) + Val(Adodc1.Recordset.Fields("销售单价")) * Val(Text2.Text) / 100
gg = Val(aa) * Val(Adodc1.Recordset.Fields("房屋销售面积"))
Set adoRs = adoCon.Execute("UPDATE Table_FWXX SET 销售单价= '" + Str(aa) + "',房产总价= '" + Str(gg) + "' where 楼盘名称='" + Combo1.Text + "' and 楼房名称='" + Combo2.Text + "' and 楼层='" + Combo3.Text + "' and 状态='未销售'")
MsgBox "调价成功!!", 32, "房地产销售管理系统"
Else
MsgBox "对不起,没有符合条件的房屋!!", 32, "房地产销售管理系统"
Text1.Text = ""
Text2.Text = ""
Text5.Text = ""
Text6.Text = ""
End If
ElseIf a = 4 Then '下调的百分比
Adodc1.RecordSource = "select * from Table_FWXX where 楼盘名称='" + Combo1.Text + "' and 楼房名称='" + Combo2.Text + "' and 楼层='" + Combo3.Text + "' and 状态='未销售'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
aa = Val(Adodc1.Recordset.Fields("销售单价")) - Val(Adodc1.Recordset.Fields("销售单价")) * Val(Text6.Text) / 100
gg = Val(aa) * Val(Adodc1.Recordset.Fields("房屋销售面积"))
Set adoRs = adoCon.Execute("UPDATE Table_FWXX SET 销售单价= '" + Str(aa) + "',房产总价= '" + Str(gg) + "' where 楼盘名称='" + Combo1.Text + "' and 楼房名称='" + Combo2.Text + "' and 楼层='" + Combo3.Text + "' and 状态='未销售'")
MsgBox "调价成功!!", 32, "房地产销售管理系统"
Else
MsgBox "对不起,没有符合条件的房屋!!", 32, "房地产销售管理系统"
Text1.Text = ""
Text2.Text = ""
Text5.Text = ""
Text6.Text = ""
End If
Else
End If
frm_FXXX.Adodc3.Refresh
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
frm_FXXX.Show
End Sub
Private Sub Form_Activate()
Combo2.Clear
Adodc1.RecordSource = "select * from Table_FWXX order by 楼房名称 "
Adodc1.Refresh
Do While Adodc1.Recordset.EOF = False
tep1 = Adodc1.Recordset.Fields("楼房名称").Value
If tep1 <> tep2 Then
Combo2.AddItem (tep1)
tep2 = tep1
Adodc1.Recordset.MoveNext
ElseIf tep1 = tep2 Then
Adodc1.Recordset.MoveNext
End If
Loop
Combo3.Clear
Adodc1.RecordSource = "select * from Table_FWXX order by 楼层 "
Adodc1.Refresh
Do While Adodc1.Recordset.EOF = False
tep1 = Adodc1.Recordset.Fields("楼层").Value
If tep1 <> tep2 Then
Combo3.AddItem (tep1)
tep2 = tep1
Adodc1.Recordset.MoveNext
ElseIf tep1 = tep2 Then
Adodc1.Recordset.MoveNext
End If
Loop
End Sub
Private Sub Form_Load()
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=ljm"
Set adoRs = adoCon.Execute("select * from View_lpmc")
adoRs.MoveFirst
Do While adoRs.EOF = False
Combo1.AddItem (adoRs.Fields("楼盘名称"))
adoRs.MoveNext
Loop
End Sub
Private Sub Option1_Click()
Option1.Value = 1
Text2.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.SetFocus
a = 1
End Sub
Private Sub Option2_Click()
Option2.Value = 1
Text2.Text = ""
Text1.Text = ""
Text6.Text = ""
Text5.SetFocus
a = 2
End Sub
Private Sub Option3_Click()
Option3.Value = 1
Text1.Text = ""
Text5.Text = ""
Text6.Text = ""
Text2.SetFocus
a = 3
End Sub
Private Sub Option4_Click()
Option4.Value = 1
Text2.Text = ""
Text5.Text = ""
Text1.Text = ""
Text6.SetFocus
a = 4
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text4.SetFocus
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -