Exemplo n.º 1
0
        public ActionResult CreateFurniture(long houseID, int furnitureTypeID)
        {
            var house         = houseRepository.GetById(houseID);
            var furnitureType = (FurnitureTypeEnum)furnitureTypeID;

            var result = houseService.CanBuildFurniture(house, furnitureType, SessionHelper.CurrentEntity);

            if (result.IsError)
            {
                return(RedirectBackWithError(result));
            }

            houseService.BuildFurniture(house, furnitureType);

            return(RedirectToAction(nameof(HouseController.Furniture), "House", new { houseID = houseID }));
        }