Esempio n. 1
0
        public ActionResult LastProperty()
        {
            PropertyViewOperation operation = new PropertyViewOperation();
            var model = operation.GetProperties(null, null).Take(3).ToList();

            return(PartialView("~/Views/Shared/_LastProperty.cshtml", model));
        }
Esempio n. 2
0
        public ActionResult SearchProperty(SearchModel filter)
        {
            PropertyViewOperation operation = new PropertyViewOperation();
            var model = operation.GetSearchedProperties(filter);

            return(View("~/Views/Property/Index.cshtml", model));
        }
Esempio n. 3
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);
     }
     
 }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        public ActionResult Detail(int? id)
        {
            PropertyViewOperation operation = new PropertyViewOperation();

            var model = operation.GetProperty(id);


            return View(model);
        }
Esempio n. 6
0
        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));
        }
Esempio n. 7
0
        // 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));
        }
Esempio n. 8
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);
 }
Esempio n. 9
0
 public ActionResult Index()
 {
     PropertyViewOperation operation = new PropertyViewOperation();
     var model = operation.GetProperties(null, User.Identity.GetUserId());
     return View(model);
 }