窗口表事件
窗口与控件事件
佣金一览表_AfterLoad
Dim cmb As WinForm.ComboBox = e.form.Controls("ComboBox1")
cmb.ComboList = DataTables("佣金明细").GetComboListString("所属区域")
'==========实现分页加载============
With DataTables("佣金明细")
.LoadFilter = "" '一定要清除加载条件
.LoadTop = 20
.LoadPage = 0
.Load()
End With
佣金一览表_Button1_Click
Dim filter As String = "1=1"
With e.Form.Controls("startDate")
If .Text > "" Then
filter &= " and 结佣日 >= #" & .text & "#"
End If
End With
With e.Form.Controls("EndDate")
If .Text > "" Then
filter &= " and 结佣日 <= #" & .text & "#"
End If
End With
Dim g As New CrossTableBuilder("佣金业绩表", DataTables("佣金明细"))
g.HGroups.AddDef("门店")
g.HGroups.AddDef("置业顾问")
g.VGroups.AddDef("类型")
g.Totals.AddDef("佣金", "佣金")
g.Totals.AddDef("套数", "套数")
g.OrderByTotal = True
g.HorizontalTotal = True
g.VerticalTotal = True
g.Decimals = 2
g.Subtotal = True
g.Filter = Filter
g.Build()
MainTable = Tables("佣金业绩表")
Forms("佣金业绩表").show()
MainTable = Tables("LILY")
佣金一览表_Button2_Click
With DataTables("佣金明细")
If .LoadPage <> 0 Then
.LoadTop = 20
.LoadPage = 0
.Load()
End If
End With
佣金一览表_Button3_Click
With DataTables("佣金明细")
If .LoadPage < .TotalPages - 1 Then
.LoadPage = .LoadPage + 1
.Load()
End If
End With
佣金一览表_Button4_Click
With DataTables("佣金明细")
If .LoadPage > 0 Then
.LoadPage = .LoadPage - 1
.Load()
End If
End With
佣金一览表_Button5_Click
With DataTables("佣金明细")
If .LoadPage < .TotalPages - 1 Then
.LoadPage = .TotalPages - 1
.Load()
End If
End With
佣金一览表_ComboBox2_Enter
Dim cmb As WinForm.ComboBox = e.Sender
Dim str As String = e.Form.Controls("ComboBox1").Value
cmb.ComboList = DataTables("佣金明细").GetComboListString("门店", "所属区域 = '" & str & "'")
佣金一览表_ComboBox3_Enter
Dim cmb As WinForm.ComboBox = e.Sender
Dim str As String = e.Form.Controls("ComboBox2").Value
cmb.ComboList = DataTables("佣金明细").GetComboListString("置业顾问", "门店 = '" & str & "'")
佣金一览表_TextBox1_TextChanged
Dim txt As String = e.Form.Controls("TextBox1").Text
Dim dt As DataTable = DataTables("佣金明细")
If txt > "" Then
txt = "'%" & txt & "%'"
txt = "合同编号 Like " & txt & " Or 甲方姓名 Like " & txt & " Or 乙方姓名 Like " & txt & " Or 物业地址 Like " & txt & " Or 门店 Like " & txt & " Or 置业顾问 Like " & txt & " Or 店面经理 Like " & txt & " Or 所属区域 Like " & txt
End If
dt.LoadFilter = txt
dt.Load
佣金一览表_查询_Click
Dim Filter As String
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = "所属区域 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "门店 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox3")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "置业顾问 = '" & .Value & "'"
End If
End With
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "结佣日 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "结佣日 <= #" & .Value & "#"
End If
End With
If e.Form.Controls("rdoYifu").Checked = True ' 如果付款状态选择了"已付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "状态 Is Not Null"
End If
If e.Form.Controls("rdoWeifu").Checked = True ' 如果付款状态选择了"未付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "状态 Is Null"
End If
If Filter > "" Then
Tables("佣金明细").Filter = Filter
End If
佣金一览表_撤销查询_Click
Tables("佣金明细").ApplyFilter = False
佣金一览表_清除条件_Click
e.Form.Controls("ComboBox1").Value = Nothing
e.Form.Controls("ComboBox2").Value = Nothing
e.Form.Controls("ComboBox3").Value = Nothing
e.Form.Controls("StartDate").Value = Nothing
e.Form.Controls("EndDate").Value = Nothing
e.Form.Controls("rdoAll").Checked = True