Ejemplo n.º 1
0
        public async Task <IActionResult> AddProperty(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var owner = await _context.Owners.FindAsync(id);


            if (owner == null)
            {
                return(NotFound());
            }

            var model = new PropertyViewModel
            {
                OwnerId       = owner.Id,
                PropertyTypes = _combosHelper.GeTComboPropertyTypes()
            };

            return(View(model));
        }
Ejemplo n.º 2
0
 public PropertyViewModel ToPropertyViewModel(Property property)
 {
     return(new PropertyViewModel
     {
         Address = property.Address,
         Contracts = property.Contracts,
         HasParkingLot = property.HasParkingLot,
         Id = property.Id,
         IsAvailable = property.IsAvailable,
         Neighborhood = property.Neighborhood,
         Owner = property.Owner,
         Price = property.Price,
         PropertyImages = property.PropertyImages,
         PropertyType = property.PropertyType,
         Remarks = property.Remarks,
         Rooms = property.Rooms,
         SquareMeters = property.SquareMeters,
         Stratum = property.Stratum,
         OwnerId = property.Owner.Id,
         PropertyTypeId = property.PropertyType.Id,
         PropertyTypes = _combosHelper.GeTComboPropertyTypes()
     });
 }