예제 #1
0
        public PetProfileViewModel PetToProfileViewModel(Pet pet)
        {
            var defaultPetImage = ConfigurationManager.AppSettings["DefaultImagePetProfile"].ToString();

            return(new PetProfileViewModel
            {
                Code = pet.Code.ToString(),
                Name = HttpUtility.HtmlDecode(pet.Name),
                SelectedSexTypeId = pet.SexType,
                DateOfBirth = pet.DateOfBirth.Date,
                Description = HttpUtility.HtmlDecode(pet.Description),
                ProfileImageUrl = !string.IsNullOrEmpty(pet.ProfileImageUrl)
                                        ? _generalHelper.FormatSiteImageUrl(pet.ProfileImageUrl)
                                        : defaultPetImage,
                Status = _generalHelper.GetPetStatus(pet.Status),
                StatusId = (PetStatusEnum)pet.Status
            });
        }
예제 #2
0
 public PetImageViewModel PetImageToPetImageViewModel(PetImage petImage)
 {
     return(new PetImageViewModel
     {
         Id = petImage.Id,
         Code = petImage.Code.ToString(),
         ImageUrl = _generalHelper.FormatSiteImageUrl(petImage.ImageUrl),
         IsProfileImage = petImage.IsProfileImage
     });
 }
예제 #3
0
 private string FormatSiteImageUrl(string imageUrl)
 {
     return(_generalHelper.FormatSiteImageUrl(imageUrl));
 }