小弟用PB做了个订单上传的软件,用于公司的各销售人员向服务器上传自己的订单,用的是数据管道。
现在主管要求添加如下功能:
每个订单都有个Complete字段(Y/N)来标识订单填写是否正确。当订单上传时,Complete默认是Y,服务器端会有专门人员来审核订单,如发现订单有错,则将该字段改为N。
销售人员需要从服务器中搜索自己上传的那些审核未通过(即Complete为N)的订单,并下载到本机上覆盖原订单,修改后重新上传。
订单中有专门一列add_emp来标识不同的销售人员,即销售人员自己的编号。
小弟接触PB时间不久,不知红字部分功能如何实现,望指教~
------解决方案--------------------
在你软件上 写个TIMER事件:用游标,做下面检索
SELECT ooxx into :ls_OOXX FROM 订单表 where add_emp = 当前销售 and Complete =N
检索结果放到一个数据窗口里,这样那边有审核没通过的当场就可以弹出列表了。
审核没通过,订单信息没变,不涉及到覆盖啊,根据列表改下本地订单表状态就好了,默认是Y 改成N
是这个意思不?
------解决方案--------------------
管道可以写where条件,而且pb里有pipeline对象,可启动管道,并带参数
Description
Executes a pipeline object, which transfers data from the source to the destination as specified by the SQL query in the pipeline object. This pipeline object is a property of a user object inherited from the pipeline system object.
Controls
Pipeline objects
Syntax
pipelineobject.Start ( sourcetrans, destinationtrans, errorobject
{, arg1, arg2,..., argn } )
Argument Description
pipelineobject The name of a pipeline user object that contains the pipeline object to be executed
sourcetrans The name of a transaction object with which to connect to the source database
destinationtrans The name of a transaction object with which to connect to the target database
errorobject The name of a DataWindow control or Data Store in which to store the pipeline error DataWindow
argn
(optional) One or more retrieval arguments as specified for the pipeline object in the Data Pipeline painter
Return value
Integer. Returns 1 if it succeeds and a negative number if an error occurs. Error values are:
-1 Pipe open failed
-2 Too many columns
-3 Table already exists
-4 Table does not exist
-5 Missing connection
-6 Wrong arguments
-7 Column mismatch
-8 Fatal SQL error in source
-9 Fatal SQL error in destination
-10 Maximum number of errors exceeded
-12 Bad table syntax
-13 Key required but not supplied
-15 Pipe already in progress
-16 Error in source database
-17 Error in destination database
-18 Destination database is read-only