Example #1
0
 private static void SetAddress(Address address, EditCollaboratorViewModel 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(EditCollaboratorViewModel registerModel)
 {
     return new Address
     {
         City = registerModel.City,
         PostalCode = registerModel.PostalCode,
         Square = registerModel.Square,
         State = registerModel.State,
         Street = registerModel.Street
     };
 }
Example #3
0
        public static EditCollaboratorViewModel ToEditCollaboratorViewModel(this Collaborator collaborator)
        {
            var collaboratorViewModel = new EditCollaboratorViewModel
            {
                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;
        }
Example #4
0
 private ActionResult Edit(EditCollaboratorViewModel model)
 {
     return View(model);
 }