예제 #1
0
        public bool RemoveQuestionObject(string q_obj_id)
        {
            int affectedRow = 0;

            Dac_QuestionEstMaps  questionEstMap  = new Dac_QuestionEstMaps();
            Dac_QuestionSubjects questionSubject = new Dac_QuestionSubjects();
            Dac_QuestionItems    questionItem    = new Dac_QuestionItems();
            Dac_QuestionDatas    questionData    = new Dac_QuestionDatas();

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

            conn.Open();
            IDbTransaction trx = conn.BeginTransaction();

            try
            {
                affectedRow += questionItem.DeleteByQObjID(conn, trx, q_obj_id);
                affectedRow += questionSubject.Delete(conn, trx, "", q_obj_id);
                affectedRow += questionEstMap.Delete(conn, trx, "", q_obj_id);
                affectedRow += _questionObject.Delete(conn, trx, q_obj_id);

                trx.Commit();
            }
            catch (Exception ex)
            {
                trx.Rollback();
                return(false);
            }
            finally
            {
                conn.Close();
            }

            return((affectedRow > 0) ? true : false);
        }
예제 #2
0
        public bool RemoveQuestionSubject(string q_sbj_id)
        {
            int affectedRow = 0;

            Dac_QuestionItems questionItem = new Dac_QuestionItems();

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

            conn.Open();
            IDbTransaction trx = conn.BeginTransaction();

            try
            {
                affectedRow += questionItem.Delete(null, null, "", q_sbj_id);
                affectedRow += _questionsubject.Delete(null, null, q_sbj_id, "");

                trx.Commit();
            }
            catch (Exception ex)
            {
                trx.Rollback();
                return(false);
            }
            finally
            {
                conn.Close();
            }

            return((affectedRow > 0) ? true : false);
        }