首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

发帖求思路解决方法

2013-01-08 
发帖求思路小弟用PB做了个订单上传的软件,用于公司的各销售人员向服务器上传自己的订单,用的是数据管道。现

发帖求思路
  小弟用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 

是这个意思不?
[解决办法]

引用:
服务器中存放着所有的订单数据,不同年份和不同销售人员的都在里面。
如果用update方式的话就把其他销售人员的订单也插入到自己的表里面了。

管道可以写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 } )

ArgumentDescription
pipelineobjectThe name of a pipeline user object that contains the pipeline object to be executed
sourcetransThe name of a transaction object with which to connect to the source database
destinationtransThe name of a transaction object with which to connect to the target database
errorobjectThe 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



If any argument's value is NULL, Start returns NULL.

Usage 

A pipeline transfer involves several PowerBuilder objects. You need:

?A pipeline object, which you define in the Data Pipeline painter. It contains the SQL statements that specify what data is transferred and how that data is mapped from the tables in the source database to those in the target database.
?A user object inherited from the pipeline system object. It inherits properties that let you check the progress of the pipeline transfer. In the painter, you define instance variables and write scripts for pipeline events.

?A window that contains a DataWindow control or a Data Store for the pipeline-error DataWindow. Do not put a DataWindow object in the DataWindow control. The control will display PowerBuilder's pipeline-error DataWindow object if errors occur when the pipeline executes.

The window can also include buttons, menus, or some other means to execute the pipeline, repair errors, and cancel the execution. The scripts for these actions will use the functions Start, Repair, and Cancel.
Before the application executes the pipeline, it needs to connect to the source and destination databases, create an instance of the user object, and assign the pipeline object to the user object's DataObject property. Then it can call Start to execute the pipeline. This code may be in one or several scripts.

When you execute the pipeline, the piped data is committed according to the settings you make in the Data Pipeline painter. You can specify that:

?The data is committed when the pipeline finishes. If the maximum error limit is exceeded, all data is rolled back.
?Data is committed at regular intervals, after a specified number of rows have been transferred. When the maximum error limit is exceeded, all rows already transferred are committed.

For information about specifying the pipeline object in the Data Pipeline painter and how the settings affect committing, see the PowerBuilder User's Guide. For more information on using a pipeline in an application, see Application Techniques.
When you dynamically assign the pipeline object to the user object's DataObject property, you must remember to include the pipeline object in a dynamic library when you build your application's executable.


[解决办法]
同意,既然订单信息没变,就不牵扯到下载,覆盖的问题。直接检索没通过的,修改本地数据的标识列就行了。至于用游标还是数据窗口什么的,随便
[解决办法]
顶贴!!!
[解决办法]
说了这么多。你自己没设计出一个良好的单据流程吧。

数据管道问题也把问题扯复杂了。

只要用一个字段来自始至终控制单据的状态即可解决问题。赋予不同单据状态下的不同操作即可。

status:
01: 录入状态,可修改;
02:本地自己审核后的状态。未上传;
03:上传到服务器,本地状态为03;服务器端为04;
04: 上传未审核单据;
05:审核通过进入正式订单系统;
06:审核未通过状态,等待业务员下载后修改;
07:审核未通过状态,业务员已下载;

业务员下载06状态的单据(只下载自己的ID的单据),下载后,将状态改成07,这样服务器端,也就是总部可以知道业务员已经在处理此订单了;
业务员下载未审核的单据后,覆盖到本地,状态改为01,重复下一个循环。

栏位应该考虑完善,比如要记录下“审核未通过的原因”,“审核人”,“审核时间”等。

这样的事情,不要想到哪里做到哪里,遇到问题修改哪里,应该早就有流程,并能演练成功并符合实际的作业流程。

具体情况再斟酌。。





-----------------------------------------------------
PB混淆器(5-12) http://chengg0769.download.csdn.net/
[解决办法]
一直用数据导入/导出工具。

[解决办法]
引用:
回楼上,小弟只是做个中间上传的软件而已,真正的订单系统以及字段设计之类我改不了什么。
小弟刚开始实习,这是我第1次用PB做软件,第1次接触订单,所以有很多地方考虑的不周全,呵呵~

我现在的疑问是如何让销售人员搜索到自己ID且Complete为N的订单,并且下载下来~

检索服务器上自己ID且Complete为N的订单,把订单编号取出去来,直接修改本地对应的订单的Complete为Y不行么,。

热点排行