예제 #1
0
 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;
         }
     }
 }
예제 #2
0
 /// <summary>
 /// 刪除綠色工廠
 /// </summary>
 /// <param name="greenFactory">被刪除的綠色工廠</param>
 public void DeleteGreenFactory(GreenFactory greenFactory)
 {
     FTISDao.DeleteGreenFactory(greenFactory);
 }
예제 #3
0
 /// <summary>
 /// 更新綠色工廠
 /// </summary>
 /// <param name="greenFactory">被更新的綠色工廠</param>
 /// <returns>更新後的綠色工廠</returns>
 public GreenFactory UpdateGreenFactory(GreenFactory greenFactory)
 {
     return FTISDao.UpdateGreenFactory(greenFactory);
 }
예제 #4
0
 /// <summary>
 /// 綠色工廠
 /// </summary>
 /// <param name="greenFactory">被新增的綠色工廠</param>
 /// <returns>新增後的綠色工廠</returns>
 public GreenFactory CreateGreenFactory(GreenFactory greenFactory)
 {
     return FTISDao.CreateGreenFactory(greenFactory);
 }
예제 #5
0
        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);
        }
예제 #6
0
 public void Insert()
 {
     GreenFactory entity = new GreenFactory();
     Save(entity);
 }