protected void LoadEntity(GreenFactory entity) { if (entity != null) { EntityId = entity.GreenFactoryId; Name = entity.Name; SortId = entity.SortId; Status = entity.Status; PostDate = entity.PostDate; Content = entity.Content; MainCode = entity.MainCode; MainName = entity.MainName; AdminCode = entity.AdminCode; AdminName = entity.AdminName; ServiceCode = entity.ServiceCode; ServiceName = entity.ServiceName; if (entity.GreenFactoryClass != null) { GreenFactoryClass = entity.GreenFactoryClass; GreenFactoryClassId = entity.GreenFactoryClass.GreenFactoryClassId; } } }
/// <summary> /// 刪除綠色工廠 /// </summary> /// <param name="greenFactory">被刪除的綠色工廠</param> public void DeleteGreenFactory(GreenFactory greenFactory) { FTISDao.DeleteGreenFactory(greenFactory); }
/// <summary> /// 更新綠色工廠 /// </summary> /// <param name="greenFactory">被更新的綠色工廠</param> /// <returns>更新後的綠色工廠</returns> public GreenFactory UpdateGreenFactory(GreenFactory greenFactory) { return FTISDao.UpdateGreenFactory(greenFactory); }
/// <summary> /// 綠色工廠 /// </summary> /// <param name="greenFactory">被新增的綠色工廠</param> /// <returns>新增後的綠色工廠</returns> public GreenFactory CreateGreenFactory(GreenFactory greenFactory) { return FTISDao.CreateGreenFactory(greenFactory); }
private void Save(GreenFactory entity) { if (GreenFactoryClassId > 0) { entity.GreenFactoryClass = m_FTISService.GetGreenFactoryClassById(GreenFactoryClassId); } else { entity.GreenFactoryClass = null; } entity.Name = Name; entity.SortId = SortId; entity.Status = Status; entity.PostDate = PostDate; entity.Content = Content; entity.MainCode = MainCode; entity.MainName = MainName; entity.AdminCode = AdminCode; entity.AdminName = AdminName; entity.ServiceCode = ServiceCode; entity.ServiceName = ServiceName; if (entity.GreenFactoryId == 0) { m_FTISService.CreateGreenFactory(entity); } else { m_FTISService.UpdateGreenFactory(entity); } LoadEntity(entity.GreenFactoryId); }
public void Insert() { GreenFactory entity = new GreenFactory(); Save(entity); }