Exemplo n.º 1
0
        public ActionResult Edit(PropertyEditInputModel input, string command)
        {
            if (ModelState.IsValid)
            {
                var request = this.propertyAdapter.UpdateProperty(input.ToBuilding());

                if (request.StatusCode == 200)
                {
                    if (command == "list")
                        return Redirect("/listing/list/" + request.Result.BuildingId);
                    if (command == "save")
                        return RedirectToAction("manage", new { id = request.Result.BuildingId });

                    HandleErrors(request);
                }
            }

            PropertyEditModel model = new PropertyEditModel(input);
            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult Edit(long id)
        {
            var request = this.propertyAdapter.GetProperty(id, User.Identity.Name);

            if (request.StatusCode != 200)
                return this.NotFoundException();

            PropertyEditModel model = new PropertyEditModel(
                new PropertyEditInputModel(request.Result)
            );
            return View(model);
        }