예제 #1
0
 private NewsClass CreateNewsClass(string name)
 {
     NewsClass newsClass = new NewsClass() { Name = name, LangId = "2", SortId = 250, Status = "1" };
     m_FTISService.CreateNewsClass(newsClass);
     Assert.AreNotEqual(0, newsClass.NewsClassId);
     return newsClass;
 }
예제 #2
0
 protected void LoadEntity(NewsClass entity)
 {
     if (entity != null)
     {
         EntityId = entity.NewsClassId;
         Name = entity.Name;
         NameENG = entity.NameENG;
         SortId = entity.SortId;
         Status = entity.Status;
     }
 }
예제 #3
0
        private void Save(NewsClass entity)
        {
            entity.Name = Name;
            entity.NameENG = NameENG;
            entity.SortId = SortId;
            entity.Status = Status;

            if (entity.NewsClassId == 0)
            {
                m_FTISService.CreateNewsClass(entity);
            }
            else
            {
                m_FTISService.UpdateNewsClass(entity);
            }

            LoadEntity(entity.NewsClassId);
        }
예제 #4
0
 public void Insert()
 {
     NewsClass entity = new NewsClass();
     Save(entity);
 }
예제 #5
0
 /// <summary>
 /// 刪除新聞分類
 /// </summary>
 /// <param name="newsClass">被刪除的新聞分類</param>
 public void DeleteNewsClass(NewsClass newsClass)
 {
     FTISDao.DeleteNewsClass(newsClass);
 }
예제 #6
0
 /// <summary>
 /// 更新新聞分類
 /// </summary>
 /// <param name="newsClass">被更新的新聞分類</param>
 /// <returns>更新後的新聞分類</returns>
 public NewsClass UpdateNewsClass(NewsClass newsClass)
 {
     return FTISDao.UpdateNewsClass(newsClass);
 }
예제 #7
0
 /// <summary>
 /// 新增新聞分類
 /// </summary>
 /// <param name="newsClass">被新增的新聞分類</param>
 /// <returns>新增後的新聞分類</returns>
 public NewsClass CreateNewsClass(NewsClass newsClass)
 {
     return FTISDao.CreateNewsClass(newsClass);
 }