示例#1
0
 private static void SetAddress(Address address, RegisterCollaboratorViewModel collaboratorViewModel)
 {
     collaboratorViewModel.Street = address.Street;
     collaboratorViewModel.Square = address.Square;
     collaboratorViewModel.PostalCode = address.PostalCode;
     collaboratorViewModel.State = address.State;
     collaboratorViewModel.City = address.City;
 }
 private static Address GetAddress(RegisterCollaboratorViewModel registerModel)
 {
     return new Address
     {
         City = registerModel.City,
         PostalCode = registerModel.PostalCode,
         Square = registerModel.Square,
         State = registerModel.State,
         Street = registerModel.Street
     };
 }
示例#3
0
        public static RegisterCollaboratorViewModel ToRegisterCollaboratorViewModel(this Collaborator collaborator)
        {
            var collaboratorViewModel = new RegisterCollaboratorViewModel
            {
                CPF = collaborator.CPF,
                Email = collaborator.Email,
                FirstName = collaborator.FirstName,
                LastName = collaborator.LastName,
                Number = collaborator.StreetNumber.ToString(),
                PhoneNumber = collaborator.Telephone,
                RG = collaborator.RG,
                Salary = collaborator.Salary.ToString()
            };

            SetAddress(collaborator.Address, collaboratorViewModel);

            return collaboratorViewModel;
        }