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; }
protected void LoadEntity(NewsClass entity) { if (entity != null) { EntityId = entity.NewsClassId; Name = entity.Name; NameENG = entity.NameENG; SortId = entity.SortId; Status = entity.Status; } }
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); }
public void Insert() { NewsClass entity = new NewsClass(); Save(entity); }
/// <summary> /// 刪除新聞分類 /// </summary> /// <param name="newsClass">被刪除的新聞分類</param> public void DeleteNewsClass(NewsClass newsClass) { FTISDao.DeleteNewsClass(newsClass); }
/// <summary> /// 更新新聞分類 /// </summary> /// <param name="newsClass">被更新的新聞分類</param> /// <returns>更新後的新聞分類</returns> public NewsClass UpdateNewsClass(NewsClass newsClass) { return FTISDao.UpdateNewsClass(newsClass); }
/// <summary> /// 新增新聞分類 /// </summary> /// <param name="newsClass">被新增的新聞分類</param> /// <returns>新增後的新聞分類</returns> public NewsClass CreateNewsClass(NewsClass newsClass) { return FTISDao.CreateNewsClass(newsClass); }