public void Remove(CohortAggregateContainer parent, AggregateConfiguration child) { CatalogueRepository.Delete("DELETE FROM CohortAggregateContainer_AggregateConfiguration WHERE CohortAggregateContainer_ID = @CohortAggregateContainer_ID AND AggregateConfiguration_ID = @AggregateConfiguration_ID", new Dictionary <string, object> { { "CohortAggregateContainer_ID", parent.ID }, { "AggregateConfiguration_ID", child.ID } }); }
/// <inheritdoc/> public void BreakLinkBetween(DataAccessCredentials credentials, TableInfo tableInfo, DataAccessContext context) { _repository.Delete( "DELETE FROM DataAccessCredentials_TableInfo WHERE DataAccessCredentials_ID = @cid AND TableInfo_ID = @tid and Context =@context", new Dictionary <string, object>() { { "cid", credentials.ID }, { "tid", tableInfo.ID }, { "context", context }, }); }
public void MakeIntoAnOrphan(IContainer container) { _catalogueRepository.Delete("DELETE FROM AggregateFilterSubContainer WHERE AggregateFilterContainer_ChildID = @AggregateFilterContainer_ChildID", new Dictionary <string, object> { { "AggregateFilterContainer_ChildID", container.ID } }, false); }
/// <inheritdoc/> public void ClearDefault(PermissableDefaults toDelete) { // Repository strictly complains if there is nothing to delete, so we'll check first (probably good for the repo to be so strict?) if (CountDefaults(toDelete) == 0) { return; } _repository.Delete("DELETE FROM ServerDefaults WHERE DefaultType=@DefaultType", new Dictionary <string, object>() { { "DefaultType", StringExpansionDictionary[toDelete] } }); }
/// <inheritdoc/> public void BreakLinkBetween(AggregateConfiguration configuration, ITableInfo tableInfo) { _repository.Delete(string.Format("DELETE FROM AggregateForcedJoin WHERE AggregateConfiguration_ID = {0} AND TableInfo_ID = {1}", configuration.ID, tableInfo.ID)); }
public void Unlink(GovernancePeriod governancePeriod, ICatalogue catalogue) { _catalogueRepository.Delete(string.Format(@"DELETE FROM GovernancePeriod_Catalogue WHERE Catalogue_ID={0} AND GovernancePeriod_ID={1}", catalogue.ID, governancePeriod.ID)); }
//[Obsolete] //public int Export2(int catalogueID, DateTime expoted) //{ // //kontrola vstupnich parametru // if (catalogueID == 0) // throw new ArgumentNullException("Neplatný parametr identifikátor katalogu."); // int result = 0; // CatalogueRepository repository = new CatalogueRepository(); // //kontrola existence katalogu // Catalogue catalogue = repository.Select(catalogueID); // if (catalogue == null) // throw new ApplicationException(String.Format("Katalog (ID={0}) neexistuje.", catalogueID)); // try // { // BookFilter filter = new BookFilter(); // filter.CatalogueID = catalogue.CatalogueID; // filter.Modified.From = expoted; // filter.Modified.To = expoted; // filter.Status = StatusCode.Exported; // List<Book> books = BookComponent.Instance.GetList(filter); // if (books != null && books.Count > 0) // { // foreach (var book in books) // { // try // { // if (book.BookID != 1) // { // //string ftpPath = Path.Combine(App.FTP_DIR, catalogue.DatabaseName, book.Modified.ToString("yyyyMMdd")); // string ftpPath = Path.Combine(App.FTP_DIR, catalogue.DatabaseName, DateTime.Now.ToString("yyyyMMdd")); // if (!Directory.Exists(ftpPath)) Directory.CreateDirectory(ftpPath); // string logFilePath = Path.Combine(ftpPath, "Export.log"); // StreamWriter sw = new StreamWriter(logFilePath, true); // if (BookComponent.Instance.Export2(book.BookID, ftpPath)) // { // string publication = book.Title; // if (!String.IsNullOrEmpty(book.Author)) // publication = String.Format("{0}: {1}", book.Author, publication); // if (!String.IsNullOrEmpty(book.Year)) // publication = String.Format("{0}, {1}", publication, book.Year); // string volume = null; // string jpgFileName = null; // string pdfFileName = null; // string txtFileName = null; // if (book.FrontCover != null) // { // jpgFileName = book.FrontCover.FileName; // } // if (book.TableOfContents != null) // { // volume = String.Format("Obsah {0}", book.Volume).Trim(); // pdfFileName = book.TableOfContents.OcrFileName; // if (book.TableOfContents.UseOCR) // { // txtFileName = book.TableOfContents.TxtFileName; // } // } // string exportBook = String.Join(" | ", new string[] { book.SysNo, publication, volume, jpgFileName, pdfFileName, txtFileName }); // sw.WriteLine(exportBook); // sw.Flush(); // sw.Close(); // sw = null; // result++; // } // } // } // catch // { // //zapis chyby do textoveho suboru Errors.log // } // } // } // } // catch (Exception ex) // { // throw new ApplicationException(String.Format("Nepodařilo se exportovat katalog (ID={0}) na FTP: {1}", catalogueID, ex.Message)); // } // return result; //} public bool Delete(int catalogueID) { CatalogueRepository repository = new CatalogueRepository(); Catalogue catalogue = repository.Select(catalogueID); return repository.Delete(catalogue); }