示例#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));
        }
示例#2
0
        public ActionResult SearchProperty(SearchModel filter)
        {
            PropertyViewOperation operation = new PropertyViewOperation();
            var model = operation.GetSearchedProperties(filter);

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

            var model = operation.GetProperty(id);


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