public void LoadEntity(EpaperExamination entity)
 {
     if (entity != null)
     {
         EntityId = entity.EpaperExaminationId;
         Name = entity.Name;
         Email = entity.Email;
         Gender = entity.Gender;
         PostDate = entity.PostDate;
         IndustryId = entity.Industry.IndustryId;
         Question1 = entity.Question1;
         Question2 = entity.Question2;
         Question3 = entity.Question3;
         Question4 = entity.Question4;
         Question5 = entity.Question5;
         Question6 = entity.Question6;
         Question7 = entity.Question7;
         Question8 = entity.Question8;
         Question9 = entity.Question9;
     }
 }        
        private void Save(EpaperExamination entity)
        {
            entity.Name = Name;
            entity.Email = Email;
            entity.Gender = Gender;            
            entity.PostDate = PostDate;
            entity.Question1 = Question1;
            entity.Question2 = Question2;
            entity.Question3 = Question3;
            entity.Question4 = Question4;
            entity.Question5 = Question5;
            entity.Question6 = Question6;
            entity.Question7 = Question7;
            entity.Question8 = Question8;
            entity.Question9 = Question9;

            if (IndustryId > 0)
            {
                entity.Industry = m_FTISService.GetIndustryById(IndustryId);
            }

            if (entity.EpaperExaminationId == 0)
            {
                if (entity.PostDate == null)
                {
                    entity.PostDate = DateTime.Now;
                }
                m_FTISService.CreateEpaperExamination(entity);
            }
            else
            {
                m_FTISService.UpdateEpaperExamination(entity);
            }

            LoadEntity(entity.EpaperExaminationId);
        }
Пример #3
0
 /// <summary>
 /// 刪除電子報滿意度問卷
 /// </summary>
 /// <param name="epaperExamination">被刪除的電子報滿意度問卷</param>
 public void DeleteEpaperExamination(EpaperExamination epaperExamination)
 {
     FTISDao.DeleteEpaperExamination(epaperExamination);
 }
Пример #4
0
 /// <summary>
 /// 更新電子報滿意度問卷
 /// </summary>
 /// <param name="epaperExamination">被更新的電子報滿意度問卷</param>
 /// <returns>更新後的電子報滿意度問卷</returns>
 public EpaperExamination UpdateEpaperExamination(EpaperExamination epaperExamination)
 {
     return FTISDao.UpdateEpaperExamination(epaperExamination);
 }
Пример #5
0
 /// <summary>
 /// 新增電子報滿意度問卷
 /// </summary>
 /// <param name="epaperExamination">被新增的電子報滿意度問卷</param>
 /// <returns>新增後的電子報滿意度問卷</returns>
 public EpaperExamination CreateEpaperExamination(EpaperExamination epaperExamination)
 {
     return FTISDao.CreateEpaperExamination(epaperExamination);
 }
 public void Insert()
 {
     EpaperExamination entity = new EpaperExamination();
     Save(entity);
 }