Example #1
0
        public PetModel(Pet pet)
        {
            PetImages = new List <PetImageModel>();

            Id                 = pet.Id;
            UserId             = pet.UserId;
            Name               = pet.Name;
            Sex                = pet.Sex;
            Description        = pet.Description;
            Breed              = pet.Breed;
            Weight             = pet.Weight;
            Years              = pet.Years;
            Months             = pet.Months;
            Spayed             = pet.Spayed;
            Microchipped       = pet.Microchipped;
            WellDogs           = pet.WellDogs;
            WellDogDetail      = pet.WellDogDetail;
            WellChild          = pet.WellChild;
            WellChildDetail    = pet.WellChildDetail;
            WellCats           = pet.WellCats;
            WellCatDetail      = pet.WellCatDetail;
            HouseTrained       = pet.HouseTrained;
            HouseTrainedDetail = pet.HouseTrainedDetail;
            SpecialRequirement = pet.SpecialRequirement;

            if (pet.PetImages != null && pet.PetImages.Count > 0)
            {
                foreach (var petImage in pet.PetImages)
                {
                    var petImageModel = new PetImageModel(petImage);
                    PetImages.Add(petImageModel);
                }
            }
        }
Example #2
0
        public SitterDetailModel(Sitter sitter)
        {
            Sitter    = new SitterModel();
            PetImages = new List <PetImageModel>();

            this.Sitter = new SitterModel(sitter);

            if (sitter.User.Pets != null)
            {
                foreach (var pet in sitter.User.Pets)
                {
                    if (pet.PetImages != null)
                    {
                        foreach (var petImage in pet.PetImages)
                        {
                            var petImageModel = new PetImageModel(petImage);
                            this.PetImages.Add(petImageModel);
                        }
                    }
                }
            }
        }