以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  这个代码的循环是不是有问题。数据总是有问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=72860)

--  作者:jinzhengbe
--  发布时间:2015/8/7 17:07:00
--  这个代码的循环是不是有问题。数据总是有问题

我想实现下面的效果

 

如果输入 shuliang值  then   price 自动从 父表 读取, dc = price 除以 markprice

 

如果 输入 dc 值    then    price = markprice * dc

 

如果输入 的是 price 值  则  dc = price / markprice

 

现在问题出在 输入price值 ,系统会自动算出 dc的值, 然后再乘以markprice  是输入的price 产生变化

 

这种情况应该怎么处理。下面是代码,谢谢指点

 

Dim dr1 As DataRow=e.DataRow.getparentrow("product")  
 
If e.DataCol.name ="shuliang" Then
 \' e.DataRow("price")=e.DataRow("dc") *e.DataRow("markprice")/100
   e.DataRow("dc") =e.DataRow("price")/ e.DataRow("markprice")*100
  e.DataRow("lr")=e.DataRow("xiaoji") - (e.DataRow("cb") * e.DataRow("shuliang"))
End If
  If e.DataCol.name ="dc"
  e.DataRow("price")=e.DataRow("dc") *e.DataRow("markprice")/100
  \' e.DataRow("dc") =e.DataRow("price")/ e.DataRow("markprice")*100
  e.DataRow("lr")=e.DataRow("xiaoji") - (e.DataRow("cb") * e.DataRow("shuliang"))
End If

 

If e.DataCol.name ="price"
   e.DataRow("dc") =e.DataRow("price")/ e.DataRow("markprice")*100
  e.DataRow("lr")=e.DataRow("xiaoji") - (e.DataRow("cb") * e.DataRow("shuliang"))

End If


--  作者:大红袍
--  发布时间:2015/8/7 17:15:00
--  

前后加上

 

SystemReady = False

 

\'你的代码

 

SystemReady = True