Пример #1
0
 public ShelterCardModel(Data.Entities.Models.Shelter shelter, Geolocation userGeolocation)
 {
     Id               = shelter.Id;
     Name             = shelter.Name;
     WebsiteUrl       = shelter.WebsiteUrl;
     City             = shelter.City;
     Address          = shelter.Address;
     ContactPhone     = shelter.ContactPhone;
     ContactEmail     = shelter.ContactEmail;
     DistanceFromUser = GeolocationHelper.GetDistance(shelter.Geolocation, userGeolocation);
 }
Пример #2
0
        public PostModel(Data.Entities.Models.Post post, Data.Entities.Models.Shelter shelter)
        {
            Title       = post.Title;
            PhotoPath   = post.PhotoPath;
            Timestamp   = post.DateTime;
            ShelterName = shelter.Name;
            ShelterId   = shelter.Id;

            var serverPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", post.ContentPath);

            Content = File.ReadAllText(serverPath);
        }
Пример #3
0
        public ShelterModel(Data.Entities.Models.Shelter shelter, int animalsCount)
        {
            Name = shelter.Name;
            City = shelter.City;
            Address = shelter.Address;
            WebsiteUrl = shelter.WebsiteUrl;
            ContactPhone = shelter.ContactPhone;
            ContactEmail = shelter.ContactEmail;
            Oib = shelter.Oib;
            Geolocation = shelter.Geolocation;

            var serverPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", shelter.DocumentationFilePath);
            Description = File.ReadAllText(serverPath);
            AnimalsCount = animalsCount;
        }