public ActionResult LastProperty() { PropertyViewOperation operation = new PropertyViewOperation(); var model = operation.GetProperties(null, null).Take(3).ToList(); return(PartialView("~/Views/Shared/_LastProperty.cshtml", model)); }
public ActionResult SearchProperty(SearchModel filter) { PropertyViewOperation operation = new PropertyViewOperation(); var model = operation.GetSearchedProperties(filter); return(View("~/Views/Property/Index.cshtml", model)); }
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); } }
public ActionResult SubmitLand(LandModel model, HttpPostedFileBase[] files) { if (files.Length == 1 && files[0] == null && !model.HasImage) { ModelState.AddModelError(string.Empty, "A photo file must be chosen."); } if (ModelState.IsValid) { PhotoProcessing(files, model); LandOperation operation = new LandOperation(); var result = operation.Execute(model, User.Identity.GetUserId()); if (result.IsSuccess) { PropertyViewOperation op = new PropertyViewOperation(); var resultModel = op.GetProperties(null, User.Identity.GetUserId()); return RedirectToAction("Index", resultModel); } } return View("Submit", model); }
public ActionResult Detail(int? id) { PropertyViewOperation operation = new PropertyViewOperation(); var model = operation.GetProperty(id); return View(model); }
public ActionResult Rent() { string userId = User.Identity.GetUserId(); PropertyViewOperation operation = new PropertyViewOperation(); var model = operation.GetProperties(PropertyStatusClassifier.Rent, userId); if (userId == null) { return(View("~/Views/Property/Index.cshtml", model)); } return(View("~/Views/Property/Edit.cshtml", model)); }
// GET: Home public ActionResult Index() { string userId = User.Identity.GetUserId(); PropertyViewOperation operation = new PropertyViewOperation(); var model = operation.GetProperties(null, userId); if (userId == null) { return(View(model)); } return(View("~/Views/Property/Edit.cshtml", model)); }
public ActionResult RecommendedProperty(PropertyTypeClassifier propertyType, int propertyId) { PropertyViewOperation operation = new PropertyViewOperation(); var model = operation.GetProperty(propertyType, propertyId); return PartialView("~/Views/Shared/_RecommendedProperties.cshtml", model); }
public ActionResult Index() { PropertyViewOperation operation = new PropertyViewOperation(); var model = operation.GetProperties(null, User.Identity.GetUserId()); return View(model); }