Пример #1
0
        /// <summary>
        /// Delete Question from the DataBase
        /// </summary>
        /// <param name="QuestionNumber"> the primary key of the selected question </param>
        public void DeletedQuestion(int QuestionNumber)
        {
            DAL.DataAccessLayer data  = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[1];

            param[0]       = new SqlParameter(@"Question_Number", SqlDbType.Int);
            param[0].Value = QuestionNumber;

            data.executeCommand("DeleteQuestions", param);
        }
Пример #2
0
        /// <summary>
        /// Insert Question on the DataBase
        /// </summary>
        public void InsertData()
        {
            DAL.DataAccessLayer data  = new DAL.DataAccessLayer();
            SqlParameter[]      param = new SqlParameter[4];

            param[0]       = new SqlParameter(@"Question", SqlDbType.VarChar, 3000);
            param[0].Value = this.question;

            param[1]       = new SqlParameter(@"Answer", SqlDbType.VarChar, 3000);
            param[1].Value = this.answer;

            param[2]       = new SqlParameter(@"Kind", SqlDbType.VarChar, 100);
            param[2].Value = this.kind;

            param[3]       = new SqlParameter(@"Levels", SqlDbType.Int);
            param[3].Value = this.level;

            data.executeCommand("InsertQuestions", param);
        }
Пример #3
0
 /// <summary>
 /// Delete All Questions from the DataBase
 /// </summary>
 public void DeletedAllQuestions()
 {
     DAL.DataAccessLayer data = new DAL.DataAccessLayer();
     data.executeCommand("DeleteAllQuestions", null);
 }