销售订单表和销售明细表初始不加载任何表数据,BeforeLoadOuterTable设置如下:
If e.DataTableName = "销售订单" Then
e.SelectString = "Select * F rom {销售订单} Where [_Identify] Is Null"
End If
If e.DataTableName = "销售明细表" Then
e.SelectString = "Select * F rom {销售明细表} Where [_Identify] Is Null"
End If
设置以后新增订单添加销售明细的时候程序无响应
添加明细按钮代码:
Dim sts() As String = {"dropbox3","DropBox1","DropBox2","NumericComboBox2"}
For Each st As String In sts
If e.Form.Controls(st).value Is Nothing Then
MessageBox.show("Please enter the name,phone number,Model and quantity !","Remind")
Return
End If
Next
Dim tbl As Table = Tables("销售明细表")
Dim r As Row = tbl.AddNew()
r("订单号") = e.Form.Controls("TextBox2").Text
r("日期") = e.Form.Controls("datetimepicker1").Text
r("客户名称") = e.Form.Controls("DropBox3").Text
r("客户电话") = e.Form.Controls("DropBox1").Text
r("产品型号") = e.Form.Controls("dropbox2").Text
r("销售单价") = e.Form.Controls("TextBox5").Text
r("数量") = e.Form.Controls("NumericComboBox2").Text
If e.Form.Controls("NumericComboBox1").Value <> 0 Then
Dim r1 As Row = Tables("订单出库明细表").AddNew
r1("提货日期") = e.Form.Controls("datetimepicker1").Text
r1("订单号") = e.Form.Controls("TextBox2").Text
r1("产品型号") = e.Form.Controls("dropbox2").Text
r1("数量") = e.Form.Controls("NumericComboBox2").Text
r1("已提数量") = e.Form.Controls("NumericComboBox1").Text
'r1.Save
End If
e.Form.Controls("DropBox2").Text = ""
e.Form.Controls("textbox5").Text = ""
e.Form.Controls("NumericComboBox2").Value = Nothing
e.Form.Controls("未提数量").Text = ""
窗口Afterload代码:
If User.Group <> "经理" Then
e.Form.Controls("订单修改").Visible = False
e.Form.Controls("Receipt").Visible = False
e.Form.Controls("Delivery").Visible = False
e.Form.Controls("Receipt").Visible = False
e.Form.Controls("textbox9").Enabled = False
End If
Dim xzcp As WinForm.Button = e.Form.Controls("新增产品")
xzcp.Enabled = False
Dim bc As WinForm.Button = e.Form.Controls("保存")
bc.Enabled = False
e.Form.Controls("Table3").Visible = False
e.Form.Controls("单价成本").Visible = False
e.Form.Controls("Position").Visible = False
DataTables("销售明细表").AddUserStyle("a", Color.Red, Color.White)
DataTables("销售订单").AddUserStyle("a", Color.Red, Color.White)
Tables("销售主界面_Table2").Filter = "1=2"
Tables("销售主界面_table2").Sort = "订单号 DESC,日期 DESC"
With Tables("销售明细表")
Tables("销售明细表").Filter = "1=2"
For Each r As Row In Tables("销售明细表").Rows
If r IsNot Nothing Then
.Cols("数量").GrandTotal = True
.Cols("金额").GrandTotal = True
.GrandTotal = True
Else
.Cols("数量").GrandTotal = True
.Cols("金额").GrandTotal = True
.GrandTotal = False
End If
Next
End With
Tables("销售明细表").Cols("单价成本").Visible = False
Tables("销售明细表").Cols("合计成本").Visible = False
Tables("销售主界面_Table2").ExtendLastCol = True
Tables("销售明细表").ExtendLastCol = True
之前不设置BeforeLoadOuterTable的时候正常,什么原因会引起这个问题?
[此贴子已经被作者于2022/3/22 2:03:41编辑过]