protected void LoadEntity(GreenFactoryClass entity)
 {
     if (entity != null)
     {
         EntityId = entity.GreenFactoryClassId;
         Name = entity.Name;
         SortId = entity.SortId;
         Status = entity.Status;
     }
 }
        private void Save(GreenFactoryClass entity)
        {
            entity.Name = Name;            
            entity.SortId = SortId;
            entity.Status = Status;

            if (entity.GreenFactoryClassId == 0)
            {
                m_FTISService.CreateGreenFactoryClass(entity);
            }
            else
            {
                m_FTISService.UpdateGreenFactoryClass(entity);
            }

            LoadEntity(entity.GreenFactoryClassId);
        }
 /// <summary>
 /// 刪除綠色工廠分類
 /// </summary>
 /// <param name="greenFactoryClass">被刪除的綠色工廠分類</param>
 public void DeleteGreenFactoryClass(GreenFactoryClass greenFactoryClass)
 {
     FTISDao.DeleteGreenFactoryClass(greenFactoryClass);
 }
 /// <summary>
 /// 更新綠色工廠分類
 /// </summary>
 /// <param name="greenFactoryClass">被更新的綠色工廠分類</param>
 /// <returns>更新後的綠色工廠分類</returns>
 public GreenFactoryClass UpdateGreenFactoryClass(GreenFactoryClass greenFactoryClass)
 {
     return FTISDao.UpdateGreenFactoryClass(greenFactoryClass);
 }
 /// <summary>
 /// 新增綠色工廠分類
 /// </summary>
 /// <param name="greenFactoryClass">被新增的綠色工廠分類</param>
 /// <returns>新增後的綠色工廠分類</returns>
 public GreenFactoryClass CreateGreenFactoryClass(GreenFactoryClass greenFactoryClass)
 {
     return FTISDao.CreateGreenFactoryClass(greenFactoryClass);
 }
 public void Insert()
 {
     GreenFactoryClass entity = new GreenFactoryClass();
     Save(entity);
 }