برای نمایش تصویر امضاها در گزارشات به جدول های زیر از پایگاه داده اتوماسیون نیاز داریم:
- EmployeePosition
- EmployeePositionSignature
- EmployeePositionSignatureImage
همچنین در سیستم BPMS از جدول زیر استفاده می کنیم:
Child Key
|
Child Table
|
Parent Key
|
Parent Table
|
EmployeeID
|
EmployeePosition
|
UserManagementId
|
WFUSER
|
EmployeePositionID_Owner
|
EmployeePositionSignature
|
EmployeePositionSignature
|
EmployeePosition
|
EmployeePositionSignatureID
|
EmployeePositionSignatureImage
|
EmployeePositionSignatureID
|
EmployeePositionSignature
|
سپس از FileImage برای چاپ امضا استفاده می کنیم.
کوئری فراخوانی تصیور امضا ها از پایگاه داده سیستم در ادامه شرح داده شده است:
SELECT EmployeePositionSignatureImage.FileImage, dbo.WFUSER.idUser, dbo.WFUSER.UserManagementId, dbo.WFUSER.fullName FROM WebOfficeData.HumanResources.EmployeePosition AS EmployeePosition INNER JOIN WebOfficeData.HumanResources.EmployeePositionSignature AS EmployeePositionSignature ON EmployeePosition.EmployeePositionID = EmployeePositionSignature.EmployeePositionID_Owner INNER JOIN WebOfficeData.HumanResources.EmployeePositionSignatureImage AS EmployeePositionSignatureImage ON EmployeePositionSignature.EmployeePositionSignatureID = EmployeePositionSignatureImage.EmployeePositionSignatureID INNER JOIN dbo.WFUSER ON EmployeePosition.EmployeeID = dbo.WFUSER.UserManagementId
همچنین می توان برای این منظور Function ایجاد نمود
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: MohammadAmin Sharifi -- Create date: 1395/06/02 -- Description: User Signature -- ============================================= CREATE FUNCTION GetUserSignature ( @UserManagementId int ) RETURNS varbinary(max) AS BEGIN
RETURN (SELECT EmployeePositionSignatureImage.FileImage FROM WebOfficeData.HumanResources.EmployeePosition AS EmployeePosition INNER JOIN WebOfficeData.HumanResources.EmployeePositionSignature AS EmployeePositionSignature ON EmployeePosition.EmployeePositionID = EmployeePositionSignature.EmployeePositionID_Owner INNER JOIN WebOfficeData.HumanResources.EmployeePositionSignatureImage AS EmployeePositionSignatureImage ON EmployeePositionSignature.EmployeePositionSignatureID = EmployeePositionSignatureImage.EmployeePositionSignatureID WHERE (EmployeePosition.EmployeeID = @UserManagementId))
END GO
kb=23
|