以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  代码哪里错了?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=91916)

--  作者:litongbo1986
--  发布时间:2016/10/21 19:45:00
--  代码哪里错了?
Select Case e.DataCol.name
    Case "移植时间"
        If e.DataRow.IsNull("移植时间") Then
            e.DataRow("时间间隔")=Nothing
        Else
              Dim t As Date
                  t = Date.Now
            Dim tp As timespan= t -e.DataRow("移植时间")
            e.DataRow("时间间隔")= tp.TotalDays
        End If
End Select


为什么说没有为类型 date 和object定义运算符?  啥意思?代码哪里错了?

--  作者:有点蓝
--  发布时间:2016/10/22 8:51:00
--  
Dim tp As timespan= t -CDate(e.DataRow("移植时间"))


--  作者:litongbo1986
--  发布时间:2016/10/23 17:10:00
--  

Select Case e.DataCol.name
    Case "回访时间"
        If e.DataRow.IsNull("回访时间") Then
            e.DataRow("剩余时间")=Nothing
        Else
            Dim t As Date
            t = Date.Now
            Dim tp As timespan= CDate(e.DataRow("回访时间"))-t
            e.DataRow("剩余时间")= tp.TotalDays
        End If
End Select

 

 

蓝老师, 这个代码如何自动更新呢 ?      比如每天代开系统后,剩余时间都会自动缩短一天


--  作者:litongbo1986
--  发布时间:2016/10/23 17:28:00
--  

DataTables("A").DataCols("剩余时间").RaiseDataColChanged()      为啥不更新呢???


--  作者:有点蓝
--  发布时间:2016/10/24 8:13:00
--  
DataTables("A").DataCols("回访时间").RaiseDataColChanged()