public override SiteProvisionerStepResponse Execute() { var response = new SiteProvisionerStepResponse(); var fileService = new FileService(); try { fileService.AssetDirectory = this.Properties.AssetDirectory; var cssUnitsOfWork = fileService.GetAddBrandingFilesToStyleLibraryWorkUnits("CSS"); // for scss var maxUnitsOfWork = cssUnitsOfWork + 1; var unitOfWork = GetUnitOfWork(); var newUnitOfWork = 0; if (unitOfWork < cssUnitsOfWork) { newUnitOfWork = fileService.AddBrandingFilesToStyleLibrary("CSS", unitOfWork); if (newUnitOfWork == 0) { newUnitOfWork = cssUnitsOfWork; } } if (newUnitOfWork == 0 || newUnitOfWork >= maxUnitsOfWork) { SetUnitOfWork(0); } else { SetUnitOfWork(newUnitOfWork); } response.Message = "CSS Files Added"; response.Success = true; } catch (Exception ex) { response.Message = ex.Message; response.Success = false; } return(response); }
public override SiteProvisionerStepResponse Execute() { var response = new SiteProvisionerStepResponse(); var fileService = new FileService(); try { fileService.AssetDirectory = this.Properties.AssetDirectory; fileService.AddBrandingFilesToStyleLibrary("img"); SetUnitOfWork(0); response.Message = "Image Files Added"; response.Success = true; } catch (Exception ex) { response.Message = ex.Message; response.Success = false; } return(response); }