public DeploymentEnviromentModel ToEntity(DeploymentEnviromentModel model, UpdateDeploymentEnvironmentToWebsite dto) { model.Git = dto.Git; model.HostingFee = dto.HostingFee; model.IsDefault = dto.IsDefault; model.Name = dto.Name; model.Url = dto.Url; return(model); }
public JsonResult RemoveStagging(UpdateDeploymentEnvironmentToWebsite dto) { var ewhWebsite = _websiteManager.GetEwhWebsite("");// dto.WebsiteId); if (ewhWebsite.RemoveStaging(dto.EnviromentId)) { return(Json(ewhWebsite, JsonRequestBehavior.AllowGet)); } else { return(Json(new { Status = ewhWebsite.EwhStatus.ToString(), Ex = ewhWebsite.EwhException, Msg = ewhWebsite.EwhErrorMessage }, JsonRequestBehavior.AllowGet)); } }
public bool AddProduction(UpdateDeploymentEnvironmentToWebsite dto) { if (!IsExits()) { return(false); } var model = new DeploymentEnviromentModel() { Website = _website }; if (_websiteRepository.AddOrUpdateProduction(ewhMapper.ToEntity(model, dto))) { return(true); } return(false); }
public IHttpActionResult AddProduction(string websiteId, UpdateDeploymentEnvironmentToWebsite dto) { if (!ModelState.IsValid) { return(BadRequest()); } var ewhWebsite = _websiteManager.GetEwhWebsite(websiteId); if (ewhWebsite == null) { return(NotFound()); } if (ewhWebsite.AddProduction(dto)) { return(Ok()); } else { return(ServerError(ewhWebsite)); } }