/// <summary> /// 插入type_group /// </summary> /// <param name="typegroup">type_group</param> public void InsertTypeGroup(TypeGroup typegroup) { try { _daoManager.BeginTransaction(); _iTypeGroupDao.InsertTypeGroup(typegroup); if (typegroup.NewsType != null) { foreach (NewsType newstype in typegroup.NewsType) { _iNewsTypeDao.InsertNewsType(newstype); } } _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; } }