Example #1
0
        private void initCatalog()
        {
            string[]        catalogNames = { "调研文章", "审批", "申请" };
            CatalogEntity[] catalogs     = new CatalogEntity[3];
            for (int index = 0; index < catalogNames.Length; index++)
            {
                catalogs[index] = new CatalogEntity(catalogNames[index]);
            }
            CatalogDao dao = new CatalogDao();

            dao.save(catalogs);
        }
Example #2
0
        public void TestCasCadeCatalog()
        {
            CatalogEntity catalog = new CatalogEntity("test cata for cascade");
            CatalogDao    dao     = new CatalogDao();

            dao.save(catalog);

            ArticleEntity article = new ArticleEntity();

            article.Author  = new ClientDao().getClientByUsername("admin");
            article.Catalog = new CatalogDao().get(catalog.CatalogName);
            article.Title   = "test title";
            article.Content = "test content";

            ArticleDao articleDao = new ArticleDao();

            articleDao.save(article);
        }
Example #3
0
 public string SaveCatalog(CatalogEntity catalog)
 {
     return(dao.save(catalog));
 }