您的位置:首页 > 编程语言

Inside Dynamics Axapta源代码赏析(二)

2006-09-26 21:43 417 查看
C.NumberSequence
作用:如何给特定模块的某个类型增加编码规则,该工程示例了给销售模块的服务订单增加编码规则.
步骤:
1.创建BikeServiceOrderId扩展数据类型,当然如果要给已经存在的扩展数据类型增加序列号分配的话,就不必增加了.
2.修改NumberSeqReference_SalesOrder类,当然如果要给其他模块的类型增加编码规则的话,就选名为_**的类.修改LoadModule方法,增加如下代码:

numRef.DataTypeId = typeId2ExtendedTypeId(
typeid(BikeServiceOrderId));
numRef.ReferenceHelp = "Unique key for the service order table, "+
"used when identification of a service "+
"order is allocated automatically.";
numRef.WizardContinuous = false;
numRef.WizardManual = NoYes::No;
numRef.WizardAllowChangeDown = NoYes::No;
numRef.WizardAllowChangeUp = NoYes::No;
numRef.SortField = 100;

this.create(numRef);
3.修改表SalesParameter,当然如果其他模块就修改**parmameter表.增加如下方法:

static client server NumberSequenceReference numRefBikeServiceOrderId()
display public DocuValueFile PromotionImage()
void printInventTable()

5.改写Body:BodyReference 的executeSection方法,增加printInventTable方法的调用.
E:ReportImageOptimized
作用:跟D工程的功能一样,只不过是优化版本.
不同之处在于在报表中定义了promotionTxt和promotionImage两个变量,BodyInventTable下的控件对应的值从这两个变量中取得,而这两个变量的值是在方法printInventTable中赋值的.
对报表的send过程细节不是很清楚,为什么这样就可以改善效率?访问数据库的次数是一样的,send的调用次数也是一样的.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: