Exemple #1
0
        public void Execute(EditBuildingForm form)
        {
            if (!form.Id.HasValue)
            {
                throw new Exception("Department Id required.");
            }

            var building = _buildingService.GetById(form.Id.Value);

            try
            {
                _buildingService.ChangeAddress(building, form.Address);
            }
            catch (EntityAlreadyExistsException e)
            {
                throw new FormException(e.Message);
            }
        }