Beispiel #1
0
 private M_Answer GetAnswerInfoFromReader(SqlDataReader reader)
 {
     M_Answer info = new M_Answer();
     info.AnswerID = DataConverter.CLng(reader["AnswerID"].ToString());
     info.SurveryID = DataConverter.CLng(reader["SurveryID"].ToString());
     info.QuestionID = DataConverter.CLng(reader["QuestionID"].ToString());
     info.OptionID = DataConverter.CLng(reader["OptionID"].ToString());
     info.AnswerContent = reader["AnswerContent"].ToString();
     info.UserID = DataConverter.CLng(reader["UserID"]);
     return info;
 }
Beispiel #2
0
        private SqlParameter[] GetParameters(M_Answer m_Answer)
        {
            SqlParameter[] parameter = new SqlParameter[] {
                new SqlParameter("@AnswerID", SqlDbType.BigInt),
                new SqlParameter("@SurveryID", SqlDbType.Int,4),
                new SqlParameter("@QuestionID", SqlDbType.Int,4),
                new SqlParameter("@OptionID", SqlDbType.Int,4),
                new SqlParameter("@AnswerContent", SqlDbType.Text),
                new SqlParameter("@UserID", SqlDbType.Int,4)

            };
            parameter[0].Value = m_Answer.AnswerID;
            parameter[1].Value = m_Answer.SurveryID;
            parameter[2].Value = m_Answer.QuestionID;
            parameter[3].Value = m_Answer.OptionID;
            parameter[4].Value = m_Answer.AnswerContent;
            parameter[5].Value = m_Answer.UserID;
            return parameter;
        }
Beispiel #3
0
 public bool UpdateAnswer(M_Answer m_Answer)
 {
     return dal.UpdateAnswer(m_Answer);
 }
Beispiel #4
0
 public bool AddAnswer(M_Answer m_Answer)
 {
     return dal.AddAnswer(m_Answer);
 }
Beispiel #5
0
 public bool UpdateAnswer(M_Answer m_Answer)
 {
     SqlParameter[] cmdParams = GetParameters(m_Answer); ;
     return SqlHelper.ExecuteProc("PR_Answer_Update", cmdParams);
 }
Beispiel #6
0
 public bool AddAnswer(M_Answer m_Answer)
 {
     string strSql = "PR_Answer_Add";
     SqlParameter[] parameter = GetParameters(m_Answer);
     return SqlHelper.ExecuteProc(strSql, parameter);
 }