Exemplo n.º 1
0
 public ActionResult EditProperty(int id, PropertyTypeClassifier type)
 {
     PropertyViewOperation p = new PropertyViewOperation();
     if (type == PropertyTypeClassifier.Apartament)
     {
         ApartmentModel model = p.GetPropertyApartment(id);
         return View("~/Views/Property/Submit.cshtml", model);
     }
     else if (type == PropertyTypeClassifier.House)
     {
         HouseModel model = p.GetPropertyHouse(id);
         return View("~/Views/Property/Submit.cshtml", model);
     }
     else if (type == PropertyTypeClassifier.Commercial)
     {
       CommercialModel model =  p.GetPropertyCommercial(id);
         return View("~/Views/Property/Submit.cshtml", model);
     }
     else
     {
        LandModel model= p.GetPropertyLand(id);
         return View("~/Views/Property/Submit.cshtml", model);
     }
     
 }
Exemplo n.º 2
0
        public List <PropertyViewModel> GetProperty(PropertyTypeClassifier type, int propertyId)
        {
            List <PropertyViewModel> result = null;

            using (PMSContext db = new PMSContext())
            {
                result = db.PropertyDetailsView.Where(x => x.TypeId == (int)type && x.PropertyId != propertyId).Select(x =>
                                                                                                                       new PropertyViewModel
                {
                    PropertyId          = x.PropertyId,
                    FloorNumber         = x.FloorNumber,
                    TotalArea           = x.TotalArea,
                    Price               = x.Price,
                    Garage              = x.Garage,
                    Bathroom            = x.Bathroom,
                    PropertyStatus      = (PropertyStatusClassifier)x.SellingCondition,
                    PropertyDescription = x.PropertyDescription,
                    PropertyType        = (PropertyTypeClassifier)x.TypeId,
                    LandArea            = x.LandArea,
                    FlatFloor           = x.FlatFloor,
                    RoomNumber          = x.RoomNumber,
                    UserId              = x.UserId,
                    PhoneNumber         = x.PhoneNumber,
                    UserImageUrl        = x.ImageUrl,
                    Firstname           = x.FirstName,
                    LastName            = x.LastName,
                    Email               = x.Email,
                    ApartmentType       = (ApartmentTypeClassifier)x.ApartmentType,
                    City     = x.City,
                    District = x.District,
                    Metro    = x.Metro,
                    AddDate  = x.AddDate,
                    Photo    = x.Photo,
                    Feature  = x.Feature
                }).ToList().OrderByDescending(x => x.AddDate).Take(7).ToList();
            }
            return(result);
        }
Exemplo n.º 3
0
 public ActionResult RecommendedProperty(PropertyTypeClassifier propertyType, int propertyId)
 {
     PropertyViewOperation operation = new PropertyViewOperation();
     var model = operation.GetProperty(propertyType, propertyId);
     return PartialView("~/Views/Shared/_RecommendedProperties.cshtml", model);
 }