调用信息的代码:
unit INFODIALOGS;
interface
uses
Business.System, Business.Model, Business.Data;
type
TINFODIALOGS = class(TInfo)
DataSetProject: TSQLDataSet;
DataSetContract: TSQLDataSet;
FIELD_Contract_CONTRACTOR_ID: TUserDataField;
DataSetStuff: TSQLDataSet;
FIELD_Stuff_DEPARTMENT_ID: TUserDataField;
FIELD_Project_PROJECT_CLASS: TUserDataField;
FIELD_Contract_AmentValue: TExprCalcField;
FIELD_Contract_AmentResult: TExprCalcField;
FIELD_Contract_CONTRACT_CATEGORY_ID: TUserDataField;
FIELD_Project_XMMC: TExprCalcField;
FIELD_Project_CONSTRUCTION: TUserDataField;
FIELD_Project_INSTALL: TUserDataField;
FIELD_Project_MACHINE: TUserDataField;
FIELD_Project_OTHER: TUserDataField;
FIELD_Project_SUMCOST: TUserDataField;
DataSetLendContract: TSQLDataSet;
FIELD_LendContract_LEND_DEPT_ID: TUserDataField;
DataSetSubject: TSQLDataSet;
DataSetContractor: TSQLDataSet;
private
{private declarations}
public
// 选择概算项目
function SelectProject: Boolean; overload;
// 选择概算项目
function SelectProject (var AProject_ID: Integer): Boolean; overload;
// 选择合同
function SelectContract: Boolean; overload;
// 选择合同
function SelectContract(var AContractID: Integer): Boolean; overload;
// 选择贷款合同
function SelectLendContract: Boolean;
// 选择合同单位(乙方)
function SelectContractor: Boolean;
// 选择人员
function SelectStuff: Boolean;
// 选择科目
function SelectSubject: Boolean;
end;
implementation
//--------------------------------- 内部函数 -----------------------------------
{ 功能:选择概算项目
参数:
返回:Boolean, 是否选择
说明:选择的项目通过访问DataSetProject数据集得到
}
function TINFODIALOGS.SelectProject: Boolean;
begin
with TWinSelProject.Create(Context) do
try
Result := ShowModal = Business.Forms.Controls.mrOk;
finally
Free;
end;
end;
{ 功能:选择概算项目
参数:
返回:Boolean, 是否选择
说明:选择的项目通过访问DataSetProject数据集得到
}
function TINFODIALOGS.SelectProject (var AProject_ID: Integer): Boolean;
begin
with TWinSelProject.Create(Context) do
try
Result := ShowModal = Business.Forms.Controls.mrOk;
AProject_ID :=DataSetProject.FieldByName('id').AsInteger;
finally
Free;
end;
end;
{ 功能:选择合同
参数:
返回:Boolean, 是否选择
说明:选择的合同通过访问DataSetContract数据集得到
}
function TINFODIALOGS.SelectContract: Boolean;
begin
with TWinSelContract.Create(Context) do
try
Result := ShowModal = Business.Forms.Controls.mrOk;
finally
Free;
end;
end;
{ 功能:选择合同
参数:[in, out] AContractID: Integer,合同默认值
返回:Boolean, 是否选择
说明:选择的合同通过访问DataSetContract数据集得到
}
function TINFODIALOGS.SelectContract(var AContractID: Integer): Boolean;
begin
with TWinSelContract.Create(Context) do
try
Result := ShowModal = Business.Forms.Controls.mrOk;
AContractID := DataSetContract.FieldByName('id').AsInteger;
finally
Free;
end;
end;
{ 功能:选择贷款合同
参数:
返回:Boolean, 是否选择
说明:选择的贷款合同通过访问DataSetLendContract数据集得到
}
function TINFODIALOGS.SelectLendContract: Boolean;
begin
with TWinSelLendContract.Create(Context) do
try
Result := ShowModal = Business.Forms.Controls.mrOk;
finally
Free;
end;
end;
{ 功能:选择合同单位(乙方)
参数:
返回:Boolean, 是否选择
说明:选择的合同单位通过访问DataSetContractor数据集得到
}
function TINFODIALOGS.SelectContractor: Boolean;
begin
with TWinSelContractor.Create(Context) do
try
Result := ShowModal = Business.Forms.Controls.mrOk;
finally
Free;
end;
end;
{ 功能:选择人员
参数:
返回:Boolean, 是否选择
说明:选择的人员通过访问DataSetStuff数据集得到
}
function TINFODIALOGS.SelectStuff: Boolean;
begin
with TWinSelStuff.Create(Context) do
try
Result := ShowModal = Business.Forms.Controls.mrOk;
finally
Free;
end;
end;
{ 功能:选择科目
参数:
返回:Boolean, 是否选择
说明:选择的科目通过访问DataSetSubject数据集得到
}
function TINFODIALOGS.SelectSubject: Boolean;
begin
with TWinSelSubject.Create(Context) do
try
Result := ShowModal = Business.Forms.Controls.mrOk;
finally
Free;
end;
end;
end. |