.NET Framework 版本:2.0.50727.8745
Foxtable 版本:2016.7.29.1
错误所在事件:表,团体订单表,DataColChanged
详细错误信息:
调用的目标发生了异常。
该字符串未被识别为有效的 DateTime。有一个从索引 10 处开始的未知字
Select Case e.DataCol.Name
Case "下单日期"
If e.DataRow.IsNull("下单日期") Then
e.DataRow("订单编号") = Nothing
Else
Dim bh As String = Format(e.DataRow("下单日期"),"yyyyMMdd") '以下单日期加时间为准生成订单号前8位
If e.DataRow("订单编号").StartsWith(bh) = False '如果编号的前8位不符
Dim max As String
Dim idx As Integer
Dim d As Date = e.DataRow("下单日期")
max = e.DataTable.Compute("Max(订单编号)","下单日期 >= #" & d.Date & "# And 下单日期 < #" & d.Date.AddDays(1) & "# And [_Identify] <> " & e.DataRow("_Identify"))'取得该天的最大编号
If max > "" Then '如果存在最大编号
idx = CInt(max.Substring(8,6))+1 '获得最大编号的后四位顺序号,并加1
Else
idx = 1 '否则顺序号等于1
End If
e.DataRow("订单编号") = bh & Format(idx,"000000")
End If
End If
Case "发货状态","客户名称","结账周期","收款状态","订单总额","商品成本","支出运费","订单利润","订单调价","调价原因","商品总额","收入运费","收货人","收货地址","客户备注","收货电话","送货日期"
Dim tr1 As Row = Tables("团体订单表").Current
Dim drs1 As List(of DataRow)
drs1 = DataTables("团体订单表").Select("订单编号 = '" & tr1("订单编号") & "'")
For Each dr As DataRow In drs1
dr(e.DataCol.Name)=tr1(e.DataCol.Name)
Next
End Select