Example #1
0
        public static List <UserAddressViewModel> MapMultipleAddresses(List <UserAddress> address)
        {
            List <UserAddressViewModel> addressVM = new List <UserAddressViewModel>();

            foreach (var s in address)
            {
                UserAddressViewModel aVm = (new UserAddressViewModel()).MapSingleAddress(s);
                addressVM.Add(aVm);
            }

            return(addressVM);
        }
Example #2
0
 public UserAddress ReverseMap(UserAddressViewModel model)
 {
     return(new UserAddress()
     {
         ID = model.ID,
         BursifyUserId = model.BursifyUserId,
         AddressType = model.AddressType,
         PreferredAddress = model.PreferredAddress,
         StreetAddress = model.StreetAddress,
         Province = model.Province,
         City = model.City,
         PostOfficeBoxNumber = model.PostOfficeBoxNumber,
         PostalCode = model.PostalCode
     });
 }
Example #3
0
 public BursifyUser MapSponsorUser(BursifyUser user)
 {
     return(new BursifyUser()
     {
         ID = user.ID,
         Email = user.Email,
         PasswordHash = user.PasswordHash,
         PasswordSalt = user.PasswordSalt,
         AccountStatus = user.AccountStatus,
         UserType = user.UserType,
         RegistrationDate = user.RegistrationDate,
         Biography = user.Biography,
         CellphoneNumber = user.CellphoneNumber,
         TelephoneNumber = user.TelephoneNumber,
         ProfilePicturePath = user.ProfilePicturePath,
         Addresses = UserAddressViewModel.ReverseMapMultipleAddresses(UserAddressViewModel.MapMultipleAddresses((List <UserAddress>)user.Addresses)),
         Sponsor = (new SponsorViewModel()).ReverseMap(user.Sponsor)
     });
 }