Ejemplo n.º 1
0
 protected void LoadEntity(Question entity)
 {
     if (entity != null)
     {
         EntityId = entity.QuestionId;
         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.QuestionClass != null)
         {
             QuestionClass = entity.QuestionClass;
             QuestionClassId = entity.QuestionClass.QuestionClassId;
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 刪除Q&A
 /// </summary>
 /// <param name="question">被刪除的Q&A</param>
 public void DeleteQuestion(Question question)
 {
     FTISDao.DeleteQuestion(question);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新Q&A
 /// </summary>
 /// <param name="question">被更新的Q&A</param>
 /// <returns>更新後的Q&A</returns>
 public Question UpdateQuestion(Question question)
 {
     return FTISDao.UpdateQuestion(question);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Q&A
 /// </summary>
 /// <param name="question">被新增的Q&A</param>
 /// <returns>新增後的Q&A</returns>
 public Question CreateQuestion(Question question)
 {
     return FTISDao.CreateQuestion(question);
 }
Ejemplo n.º 5
0
        private void Save(Question entity)
        {
            if (QuestionClassId > 0)
            {
                entity.QuestionClass = m_FTISService.GetQuestionClassById(QuestionClassId);
            }
            else
            {
                entity.QuestionClass = 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.QuestionId == 0)
            {
                m_FTISService.CreateQuestion(entity);
            }
            else
            {
                m_FTISService.UpdateQuestion(entity);
            }

            LoadEntity(entity.QuestionId);
        }
Ejemplo n.º 6
0
 public void Insert()
 {
     Question entity = new Question();
     Save(entity);
 }