Пример #1
0
        public CompanyModel BuildToCompanyModel(Company company)
        {
            CompanyModel companyModel = new CompanyModel
            {
                Id                        = company.Id,
                Guid                      = company.Guid,
                Name                      = company.Name,
                OrganisationId            = company.OrganisationId,
                RegisteredName            = company.RegisteredName,
                TradingName               = company.TradingName,
                NatureOfBusiness          = company.NatureOfBusiness,
                CompanyRegistrationNumber = company.CompanyRegistrationNumber,
                TaxNumber                 = company.TaxNumber,
                UifReferenceNumber        = company.UifReferenceNumber,
                PayeReferenceNumber       = company.PayeReferenceNumber,
                UifCompanyReferenceNumber = company.UifCompanyReferenceNumber,
                SarsUifNumber             = company.SarsUifNumber,
                PaysdlInd                 = company.PaysdlInd,
                FaxNumber                 = company.FaxNumber,
                EmailAddress              = company.EmailAddress,
                ContactNumber             = company.ContactNumber,
                LogoFileName              = company.LogoFileName
            };

            companyModel.Address = new CompanyAddressModel
            {
                CompanyId       = company.Id,
                PhysicalAddress = addressBuilder.BuildToModel(company.PhysicalAddress),
                PostalAddress   = addressBuilder.BuildToModel(company.PostalAddress)
            };

            return(companyModel);
        }
        public EmployeeModel BuildToEmployeeModel(Employee employee)
        {
            EmployeeModel employeeModel = new EmployeeModel
            {
                Title                 = employee.Title,
                FirstName             = employee.FirstName,
                Initials              = employee.Initials,
                LastName              = employee.LastName,
                NickName              = employee.NickName,
                DateOfBirth           = employee.DateOfBirth,
                Gender                = employee.Gender,
                DisabilityDescription = employee.DisabilityDescription,
                MaritalStatus         = employee.MaritalStatus,
                HomeLanguage          = employee.HomeLanguage,
                TaxReferenceNumber    = employee.TaxReferenceNumber,
                StatusId              = employee.StatusId,
                EthnicGroup           = employee.EthnicGroup,
                EmployeeNumber        = employee.EmployeeNumber,
                IdOrPassportNumber    = employee.IdOrPassportNumber,
                EmailAddress          = employee.EmailAddress,
                WorkNumber            = employee.WorkNumber,
                HomeNumber            = employee.HomeNumber,
                MobileNumber          = employee.MobileNumber,
                ImageFileName         = employee.ImageFileName
            };

            employeeModel.Address = new EmployeeAddressModel
            {
                EmployeeId      = employee.Id,
                PhysicalAddress = addressBuilder.BuildToModel(employee.PhysicalAddress),
                PostalAddress   = addressBuilder.BuildToModel(employee.PostalAddress)
            };

            return(employeeModel);
        }
Пример #3
0
        public OrganisationModel BuildModel(Organisation organisation)
        {
            OrganisationModel organisationModel = new OrganisationModel();

            organisationModel.Id              = organisation.Id;
            organisationModel.Guid            = organisation.Guid;
            organisationModel.Name            = organisation.Name;
            organisationModel.Description     = organisation.Description;
            organisationModel.FaxNumber       = organisation.FaxNumber;
            organisationModel.ContactNumber   = organisation.ContactNumber;
            organisationModel.EmailAddress    = organisation.EmailAddress;
            organisationModel.LogoFileName    = organisation.LogoFilename;
            organisationModel.PhysicalAddress = addressBuilder.BuildToModel(organisation.PhysicalAddress);
            organisationModel.PostalAddress   = addressBuilder.BuildToModel(organisation.PostalAddress);

            return(organisationModel);
        }