Exemple #1
0
        protected void LoadEntity(Norm entity)
        {
            if (entity != null)
            {
                #region 中文欄位

                EntityId = entity.NormId;
                Name = entity.Name;
                SortId = entity.SortId;
                Status = entity.Status;
                Content = entity.Content;
                Pic1 = entity.Pic1;                
                MainCode = entity.MainCode;
                MainName = entity.MainName;
                AdminCode = entity.AdminCode;
                AdminName = entity.AdminName;
                ServiceCode = entity.ServiceCode;
                ServiceName = entity.ServiceName;
                Tag = entity.Tag;

                if (entity.NormClass != null)
                {
                    NormClass = entity.NormClass;
                    NormClassId = entity.NormClass.NormClassId;
                }

                if (entity.NormClassParent != null)
                {
                    NormClassParent = entity.NormClassParent;
                    NormClassParentId = entity.NormClassParent.NormClassId;
                }

                #endregion
            }
        }
 /// <summary>
 /// 刪除標準/規範資訊
 /// </summary>
 /// <param name="norm">被刪除的標準/規範資訊</param>
 public void DeleteNorm(Norm norm)
 {
     FTISDao.DeleteNorm(norm);
 }
 /// <summary>
 /// 更新標準/規範資訊
 /// </summary>
 /// <param name="norm">被更新的標準/規範資訊</param>
 /// <returns>更新後的標準/規範資訊</returns>
 public Norm UpdateNorm(Norm norm)
 {
     return FTISDao.UpdateNorm(norm);
 }
 /// <summary>
 /// 新增標準/規範資訊
 /// </summary>
 /// <param name="norm">被新增的標準/規範資訊</param>
 /// <returns>新增後的標準/規範資訊</returns>
 public Norm CreateNorm(Norm norm)
 {
     return FTISDao.CreateNorm(norm);
 }
Exemple #5
0
        private void Save(Norm entity)
        {
            if (NormClassId > 0)
            {
                entity.NormClass = m_FTISService.GetNormClassById(NormClassId);
            }
            else
            {
                entity.NormClass = null;
            }

            if (NormClassParentId > 0)
            {
                entity.NormClassParent = m_FTISService.GetNormClassById(NormClassParentId);
            }
            else
            {
                entity.NormClassParent = null;
            }

            #region 中文欄位

            entity.Name = Name;
            entity.SortId = SortId;
            entity.Status = Status;
            entity.Content = Content;
            entity.Pic1 = Pic1;            
            entity.MainCode = MainCode;
            entity.MainName = MainName;
            entity.AdminCode = AdminCode;
            entity.AdminName = AdminName;
            entity.ServiceCode = ServiceCode;
            entity.ServiceName = ServiceName;
            entity.Tag = Tag;

            #endregion

            if (entity.NormId == 0)
            {
                m_FTISService.CreateNorm(entity);
            }
            else
            {
                m_FTISService.UpdateNorm(entity);
            }

            LoadEntity(entity.NormId);
        }
Exemple #6
0
 public void Insert()
 {
     Norm entity = new Norm();
     Save(entity);
 }