Exemplo 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));
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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));
        }
Exemplo n.º 4
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));
        }
Exemplo n.º 5
0
 public ActionResult Index()
 {
     PropertyViewOperation operation = new PropertyViewOperation();
     var model = operation.GetProperties(null, User.Identity.GetUserId());
     return View(model);
 }