Example #1
0
        /// <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()));
        }
Example #2
0
        /// <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()));
        }