public void DeleteSite() { int selectedSite = _view.SelectedSite >= 0 ? _view.SelectedSite : 0; _repository.DeleteSite(selectedSite); UpdateSiteListView(); }
public void DeleteSite(t_Sites site) { try { siteRepository.DeleteSite(site); } catch (Exception ex) { // throw ex; } }
public void Delete(int id) { Site Site = Sites.GetSite(id); if (Sites.GetSites().Count() > 1) { Sites.DeleteSite(id); logger.Log(Site.SiteId, LogLevel.Information, this, LogFunction.Delete, "Site Deleted {SiteId}", id); } else { logger.Log(Site.SiteId, LogLevel.Warning, this, LogFunction.Delete, "Unable to delete the root site."); } }
public IActionResult Delete(long id) { _logger.LogInformation(LoggingEvents.DeleteItem, "Delete Site", "Id ", id); var site = _siteRepository.Sites.FirstOrDefault(s => s.Id == id); if (site == null) { _logger.LogInformation(LoggingEvents.DeleteItem, "Delete Site", "Not Found Id ", id); return(NotFound()); } _siteRepository.DeleteSite(id); return(new NoContentResult()); }
public ActionResult DeleteSite(Guid companyId, Guid siteTypeId, Guid siteId) { var siteFromRepo = _siteRepository.GetSite(companyId, siteTypeId, siteId); if (siteFromRepo == null) { return(NotFound()); } _siteRepository.DeleteSite(siteFromRepo); _siteRepository.Save(); return(NoContent()); }
public void Delete(int id) { var site = _sites.GetSite(id); if (site != null && site.SiteId == _alias.SiteId) { _sites.DeleteSite(id); _logger.Log(id, LogLevel.Information, this, LogFunction.Delete, "Site Deleted {SiteId}", id); } else { _logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized Site Delete Attempt {SiteId}", id); HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden; } }
public void Delete(int id) { _sites.DeleteSite(id); _logger.Log(id, LogLevel.Information, this, LogFunction.Delete, "Site Deleted {SiteId}", id); }
public void Delete(int id) { _siteRepo.DeleteSite(id); }
public void Delete(int id) { Sites.DeleteSite(id); }
public Site Delete(Guid siteId) { return(_siteRepository.DeleteSite(siteId)); }