/// <summary> /// 插入news /// </summary> /// <param name="news">news</param> public void InsertNews(News news) { try { _daoManager.BeginTransaction(); _iNewsDao.InsertNews(news); _daoManager.CommitTransaction(); } catch (Exception ex) { _daoManager.RollBackTransaction(); throw ex; } }
/// <summary> /// 插入news_type /// </summary> /// <param name="newstype">news_type</param> public void InsertNewsType(NewsType newstype) { try { _daoManager.BeginTransaction(); _iNewsTypeDao.InsertNewsType(newstype); if (newstype.News != null) { foreach (News news in newstype.News) { _iNewsDao.InsertNews(news); } } _daoManager.CommitTransaction(); } catch (Exception ex) { _daoManager.RollBackTransaction(); throw ex; } }