Exemplo n.º 1
0
        public JsonResult EditRentalListing(RentListingModel model)
        {
            var user = User.Identity.Name;

            if (String.IsNullOrEmpty(user))
            {
                return(Json(new { Success = false }));
            }
            var login = AccountService.GetLoginByEmail(user);

            if (ModelState.IsValid)
            {
                var files  = Request.Files;
                var result = RentalService.EditRentalListing(model, files, login);
                return(Json(new { Success = result.IsSuccess, MediaFiles = result.Result }));
            }
            return(Json(new { Success = false }));
        }