/// <summary> /// Returns the Report Field parameters of the PersonContact table Contact relationship Linked field. /// When a report is produced, the ContactRelationshipId int? field value is linked to the Picklist to fetch the Contact Relationship description for the particular Organisation. /// </summary> /// <returns>Tuple<string, string, string, FieldOptions, FieldPermissions></returns> private static Tuple <string, string, string, FieldOptions, FieldPermissions> Relationship() { /* fparams = sqlTableName: sqlFieldName: fieldName: displayName: description: fieldType:dataModelType: primitiveType:extractionType: LastModifiedUser */ string desc = "Person's contact Relationship Description"; string fparams = $"personcontact:relationship:ContactRelationshipId:Relationship:{desc}:EmployeeSubrecord:PersonContact:String:Linked:Init"; Type personContactType = new PersonContactDDM().GetType(); PropertyInfo pcPropertyInfo = personContactType.GetProperty("ContactRelationshipId"); Type picklistType = new PicklistDDM().GetType(); PropertyInfo picklistId = picklistType.GetProperty("Id"); PropertyInfo picklistDescription = picklistType.GetProperty("Description"); LinkedInput linkedInput = new LinkedInput() { SourceFieldType = FieldTypeEnum.EmployeeSubrecord, SourceDataModelType = DataModelTypeEnum.PersonContact, SourceLinkFieldName = pcPropertyInfo.Name, SourceLinkPrimitiveType = PrimitiveTypeEnum.NullableInt, TargetDataModelType = DataModelTypeEnum.Picklist, TargetFieldType = FieldTypeEnum.Organisation, TargetLinkFieldName = picklistId.Name, TargetLinkPrimitiveType = PrimitiveTypeEnum.NullableInt, TargetFieldName = picklistDescription.Name, TargetPrimitiveType = PrimitiveTypeEnum.String }; string linkedDTO = LinkedInput.MapToDTO(linkedInput); FieldOptions foptions = new FieldOptions() { CustomFormatString = "", DisplayMode = DataDisplayModeEnum.Text, DecimalPlaces = 0, MaxColumnLength = 25, DisplayNamePlaceHolder = "" }; return(Tuple.Create(fparams, "", linkedDTO, foptions, new FieldPermissions())); }
/// <summary> /// Create the Report Field parameters of the Absence table AbsenceCategory Linked field. /// When a report is produced, the Absence Category Id is linked to the Picklist to fetch the Absence Category description for the particular Organisation /// </summary> /// <returns></returns> private static Tuple <string, string, string, FieldOptions, FieldPermissions> AbsenceCategory() { /* fparams = sqlTableName: sqlFieldName: fieldName: displayName: description: fieldType:dataModelType: primitiveType:extractionType: LastModifiedUser */ string desc = "Employee's Absence Category Description"; string fparams = $"absence:absencecategory:AbsenceCategory:Category:{desc}:EmployeeSubrecord:Absence:String:Linked:Init"; Type absenceType = new CareerHistoryDDM().GetType(); PropertyInfo absencePropertyInfo = absenceType.GetProperty("AbsenceCategory"); Type picklistType = new PicklistDDM().GetType(); PropertyInfo picklistId = picklistType.GetProperty("Id"); PropertyInfo picklistDescription = picklistType.GetProperty("Description"); LinkedInput linkedInput = new LinkedInput() { SourceFieldType = FieldTypeEnum.EmployeeSubrecord, SourceDataModelType = DataModelTypeEnum.Absence, SourceLinkFieldName = absencePropertyInfo.Name, SourceLinkPrimitiveType = PrimitiveTypeEnum.NullableInt, TargetDataModelType = DataModelTypeEnum.Picklist, TargetFieldType = FieldTypeEnum.Organisation, TargetLinkFieldName = picklistId.Name, TargetLinkPrimitiveType = PrimitiveTypeEnum.NullableInt, TargetFieldName = picklistDescription.Name, TargetPrimitiveType = PrimitiveTypeEnum.String }; string linkedDTO = LinkedInput.MapToDTO(linkedInput); FieldOptions foptions = new FieldOptions() { CustomFormatString = "", DisplayMode = DataDisplayModeEnum.Text, DecimalPlaces = 0, MaxColumnLength = 25, DisplayNamePlaceHolder = "" }; return(Tuple.Create(fparams, "", linkedDTO, foptions, new FieldPermissions())); }
/// <summary> /// Returns the Report Field parameters of the Payment table's Type Linked field. /// When a report is produced, the Type int? field value is linked to the a /// Systemn Enum & its description is returned as the value for the particular Organisation. /// </summary> /// <returns>Tuple<string, string, string, FieldOptions, FieldPermissions> </returns> private static Tuple <string, string, string, FieldOptions, FieldPermissions> Type() { string desc = "Payment Start Date"; /* fparams = sqlTableName: sqlFieldName: fieldName: displayName: description: fieldType:dataModelType: primitiveType:extractionType: LastModifiedUser */ string fparams = $"payment:type:Type:Type:{desc}:EmployeeSubrecord:Payment:NullableDateTime:Linked:Init"; Type paymentType = new PaymentDDM().GetType(); PropertyInfo pyPropertyInfo = paymentType.GetProperty("Type"); LinkedInput linkedInput = new LinkedInput() { SourceFieldType = FieldTypeEnum.EmployeeSubrecord, SourceDataModelType = DataModelTypeEnum.Payment, SourceLinkFieldName = pyPropertyInfo.Name, SourceLinkPrimitiveType = PrimitiveTypeEnum.NullableInt, TargetDataModelType = DataModelTypeEnum.Enum, TargetFieldType = FieldTypeEnum.Organisation, TargetLinkFieldName = pyPropertyInfo.Name, TargetLinkPrimitiveType = PrimitiveTypeEnum.NullableInt, TargetFieldName = pyPropertyInfo.Name, TargetPrimitiveType = PrimitiveTypeEnum.String }; string linkedDTO = LinkedInput.MapToDTO(linkedInput); FieldOptions foptions = new FieldOptions() { CustomFormatString = "", DisplayMode = DataDisplayModeEnum.Text, DecimalPlaces = 0, MaxColumnLength = 25, DisplayNamePlaceHolder = "" }; return(Tuple.Create(fparams, "", linkedDTO, foptions, new FieldPermissions())); }