예제 #1
0
 public ClientRegistrationDTO(ClientDemographicDTO clientDemographic, ClientContactAddressDTO clientContactAddress, ClientProfileDTO clientProfile, ClientEnrollmentDTO clientEnrollment)
 {
     ClientDemographic    = clientDemographic;
     ClientContactAddress = clientContactAddress;
     ClientProfile        = clientProfile;
     ClientEnrollment     = clientEnrollment;
 }
        public static ClientDemographicDTO CreateFromClient(Client client, bool downloaded)
        {
            var demographicDTO = new ClientDemographicDTO();

            //Person

            if (null != client)
            {
                if (null != client.Person)
                {
                    var model = client.Person;
                    demographicDTO = new ClientDemographicDTO(
                        model.FirstName,
                        model.MiddleName,
                        model.LastName,
                        model.Gender,
                        model.BirthDate,
                        model.NickName);

                    demographicDTO.PersonId   = model.Id.ToString();
                    demographicDTO.Downloaded = downloaded;
                }
            }


            return(demographicDTO);
        }
예제 #3
0
        public static ClientRegistrationDTO Create(Client client)
        {
            var clientRegistrationDTO =
                new ClientRegistrationDTO
            {
                ClientDemographic    = ClientDemographicDTO.CreateFromClient(client),
                ClientContactAddress = ClientContactAddressDTO.CreateFromClient(client),
                ClientProfile        = ClientProfileDTO.CreateFromClient(client),
                ClientEnrollment     = ClientEnrollmentDTO.CreateFromClient(client)
            };

            return(clientRegistrationDTO);
        }
        public static ClientRegistrationDTO Create(Client client)
        {
            var clientRegistrationDto =
                new ClientRegistrationDTO
            {
                ClientDemographic    = ClientDemographicDTO.CreateFromClient(client, client.Downloaded),
                ClientContactAddress = ClientContactAddressDTO.CreateFromClient(client, client.Downloaded),
                ClientProfile        = ClientProfileDTO.CreateFromClient(client, client.Downloaded),
                ClientEnrollment     = ClientEnrollmentDTO.CreateFromClient(client, client.Downloaded)
            };

            clientRegistrationDto.Downloaded = client.Downloaded;

            return(clientRegistrationDto);
        }
예제 #5
0
        public static ClientDemographicDTO CreateFromView(ClientDemographicViewModel model)
        {
            var demographicDTO = new ClientDemographicDTO(
                model.FirstName,
                model.MiddleName,
                model.LastName,
                model.SelectedGender.Value,
                model.BirthDate,
                model.Age,
                model.SelectedAgeUnit.Value,
                model.NickName
                );

            demographicDTO.PersonId = model.PersonId;
            return(demographicDTO);
        }