unit BFDNUMBERPARAMS;
interface
uses
Business.System, Business.Model, CommonUtils;
type
TBFDNUMBERPARAMS = class(TBizParamGroup)
ParamBPCustomerNO: TBizParam;
ParamBPCustomerPrjNO: TBizParam;
ParamBPAffairNO: TBizParam;
ParamBPTaskNO: TBizParam;
ParamProductNo: TBizParam;
ParamCode: TBizParam;
BizParam1: TBizParam;
procedure ParamBPCustomerNOGetValue(Sender: TObject; var Value: Variant);
procedure ParamBPCustomerPrjNOGetValue(Sender: TObject; var Value: Variant);
procedure ParamBPTaskNOGetValue(Sender: TObject; var Value: Variant);
procedure ParamBPAffairNOGetValue(Sender: TObject; var Value: Variant);
procedure ParamProductNoGetValue(Sender: TObject; var Value: Variant);
procedure ParamCodeGetValue(Sender: TObject; var Value: Variant);
procedure BizParam1GetValue(Sender: TObject; var Value: Variant);
private
{private declarations}
public
{public declarations}
end;
implementation
procedure TBFDNUMBERPARAMS.ParamBPCustomerNOGetValue(Sender: TObject; var Value: Variant);
begin
Value := TCommonUtils.GetAutoIncreaseID(Self.Context,
TBizParam(Sender).ID, TBizParam(Sender).DisplayName);
{ 可根据需要定制Value的格式 }
Value := TCommonUtils.StrToRightLenStr(Variants.VarToStr(Value), '0', 10);
end;
procedure TBFDNUMBERPARAMS.ParamBPCustomerPrjNOGetValue(Sender: TObject; var Value: Variant);
var
lTempStr: string;
begin
Value := TCommonUtils.GetAutoIncreaseID(Self.Context,
TBizParam(Sender).ID, TBizParam(Sender).DisplayName);
{ 可根据需要定制Value的格式 }
lTempStr := TCommonUtils.StrToRightLenStr(Variants.VarToStr(Value), '0', 9);
Value := 'P' + lTempStr;
end;
procedure TBFDNUMBERPARAMS.ParamBPTaskNOGetValue(Sender: TObject; var Value: Variant);
begin
Value := TCommonUtils.GetAutoIncreaseID(Self.Context,
TBizParam(Sender).ID, TBizParam(Sender).DisplayName);
{ 可根据需要定制Value的格式 }
Value := TCommonUtils.StrToRightLenStr(Variants.VarToStr(Value), '0', 10);
end;
procedure TBFDNUMBERPARAMS.ParamBPAffairNOGetValue(Sender: TObject; var Value: Variant);
begin
Value := TCommonUtils.GetAutoIncreaseID(Self.Context,
TBizParam(Sender).ID, TBizParam(Sender).DisplayName);
{ 可根据需要定制Value的格式 }
Value := TCommonUtils.StrToRightLenStr(Variants.VarToStr(Value), '0', 10);
end;
procedure TBFDNUMBERPARAMS.ParamProductNoGetValue(Sender: TObject; var Value: Variant);
begin
Value := TCommonUtils.GetAutoIncreaseID(Self.Context,
TBizParam(Sender).ID, TBizParam(Sender).DisplayName);
{ 可根据需要定制Value的格式 }
Value := TCommonUtils.StrToRightLenStr(Variants.VarToStr(Value), '0', 10);
end;
procedure TBFDNUMBERPARAMS.ParamCodeGetValue(Sender: TObject; var Value: Variant);
begin
Value := TCommonUtils.GetAutoIncreaseID(Self.Context,
TBizParam(Sender).ID, TBizParam(Sender).DisplayName);
{ 可根据需要定制Value的格式 }
Value := TCommonUtils.StrToRightLenStr(Variants.VarToStr(Value), '0', 10);
end;
procedure TBFDNUMBERPARAMS.BizParam1GetValue(Sender: TObject; var Value: Variant);
begin
Value := TCommonUtils.GetAutoIncreaseID(Self.Context,
TBizParam(Sender).ID, TBizParam(Sender).DisplayName);
{ 可根据需要定制Value的格式 }
Value := TCommonUtils.StrToRightLenStr(Variants.VarToStr(Value), '0', 10);
end;
end.
这是打开任务编码参数的代码,原来这个参数在自动填充中套用后显示为000000000X 的形式,现在我想修改为000X的形式,但是由于代码没有注释,所以我不知道应该在哪修改代码才能控制参数只显示四位数. |