Exemple #1
0
 private void btnNewQB_Click(object sender, EventArgs e)
 {
     QbQuestionsEntityState = EntityOperationalState.New;
     isQBQuestionChanged    = false;
     ResetAll();
     dgvQB.Rows.Clear();
 }
Exemple #2
0
        private void dgQuestions_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            List <Question>     questionColl     = null;
            List <string>       questionIDs      = null;
            string              quesModeID       = string.Empty;
            string              questionID       = string.Empty;
            MasterDataFunctions mDataFunc        = null;
            QuestionType        qtype            = null;
            List <QuestionType> questionTypeColl = null;

            try
            {
                mDataFunc   = new MasterDataFunctions();
                questionIDs = new List <string>();
                questionIDs.Add(dgQuestions.Rows[e.RowIndex].Cells[0].Value.ToString());
                questionColl                 = mDataFunc.LoadQuestion(questionIDs);
                EditedQuestion               = questionColl[0];
                txtQuestion.Text             = dgQuestions.Rows[e.RowIndex].Cells[1].Value.ToString();
                txtPoint.Text                = dgQuestions.Rows[e.RowIndex].Cells[2].Value.ToString();
                cbComplexlevel.SelectedIndex = cbComplexlevel.FindString(EditedQuestion.ComplexLevel);//cbComplexlevel.FindString(dgQuestions.Rows[e.RowIndex].Cells[3].Value.ToString());

                questionTypeColl             = mDataFunc.LoadQuestionTypeByQID(EditedQuestion.ID);
                qtype                        = questionTypeColl.Where(qt => qt.Type == QuestionTypes.Mode).SingleOrDefault();
                cbQuestionMode.SelectedIndex = cbQuestionMode.FindString(qtype.Code);    // cbQuestionMode.FindString(dgQuestions.Rows[e.RowIndex].Cells[4].Value.ToString());

                QuestionOperatonState = EntityOperationalState.Update;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #3
0
        private void btnQBEdit_Click_1(object sender, EventArgs e)
        {
            MasterDataFunctions         mDataFunc   = null;
            List <QuestionBank>         qbColl      = null;
            Dictionary <string, string> comboSource = null;
            string qbID = string.Empty;

            try
            {
                ResetAll();
                QbQuestionsEntityState = EntityOperationalState.Update;
                isQBQuestionChanged    = false;

                qbID      = ((KeyValuePair <string, string>)cbQB.SelectedItem).Key;
                mDataFunc = new MasterDataFunctions();
                qbColl    = mDataFunc.LoadQuestionBank(qbID);


                if (qbColl != null)
                {
                    txtQBName.Text    = qbColl[0].ExamName;
                    txtQBRemarks.Text = qbColl[0].Remarks;

                    qbColl[0].Questions.ForEach(qb => htQBOrder.Add(qb.QuestionRelation.ID, qb.Order));
                    selectedQuestionRelation.AddRange(qbColl[0].Questions.Select(qbq => qbq.QuestionRelation));
                    LoadQBQuestions(selectedQuestionRelation);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #4
0
 private void ResetAll()
 {
     txtAnswer.Text      = string.Empty;
     txtAnswerOrder.Text = string.Empty;
     // txtQuestion.Text = string.Empty;
     AnswerOperatonState = EntityOperationalState.New;
     EditedAnswer        = null;
 }
Exemple #5
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            txtQuestion.Text             = string.Empty;
            txtPoint.Text                = string.Empty;
            cbComplexlevel.SelectedIndex = 0;
            cbQuestionMode.SelectedIndex = 0;

            QuestionOperatonState = EntityOperationalState.New;
        }
Exemple #6
0
 private void frmQuestions_Load(object sender, EventArgs e)
 {
     LoadData();
     LoadQuestionsGrid();
     if (cbGroupType.Items.Count > 0)
     {
         cbGroupType.SelectedIndex = 0;
         cbGroupType_SelectionChangeCommitted(null, null);
     }
     QuestionOperatonState = EntityOperationalState.New;
 }
Exemple #7
0
        private void frmQuestionBank_Load(object sender, EventArgs e)
        {
            QbQuestionsEntityState   = EntityOperationalState.New;
            qbQuestions              = new QBQuestions();
            currentQuestionRelation  = new List <QuestionRelation>();
            selectedQuestionRelation = new List <QuestionRelation>();
            htQBOrder = new Hashtable();

            LoadData();
            LoadQBCombo();
        }
Exemple #8
0
        private void ResetAll()
        {
            txtPartiCode.Text = string.Empty;
            txtPartiName.Text = string.Empty;
            txtEmail.Text     = string.Empty;
            txtRemarks.Text   = string.Empty;

            cbParticipent.DataSource  = null;
            lstAvailableQB.DataSource = null;
            lstSelectedQB.DataSource  = null;
            ParticipentQBEntityState  = EntityOperationalState.New;
            eidtedParticipentInfo     = new ParticeipentInfo();
        }
Exemple #9
0
        private void frmQuestionBank_Load(object sender, EventArgs e)
        {
            QbQuestionsEntityState   = EntityOperationalState.New;
            qbQuestions              = new QBQuestions();
            currentQuestionRelation  = new List <QuestionRelation>();
            selectedQuestionRelation = new List <QuestionRelation>();
            htQBOrder = new Hashtable();

            LoadData();
            LoadQBCombo();
            cbAQGroupType.SelectedIndex = 0;
            cbAQGroupType_SelectionChangeCommitted(null, null);
        }
Exemple #10
0
 private void ResetAll()
 {
     ResetAllQB();
     ResetAllAQ();
     txtQBName.Text           = string.Empty;
     txtQBRemarks.Text        = string.Empty;
     currentQuestionRelation  = new List <QuestionRelation>();
     selectedQuestionRelation = new List <QuestionRelation>();
     qbQuestions            = new QBQuestions();
     htQBOrder              = new Hashtable();
     QbQuestionsEntityState = EntityOperationalState.None;
     isQBQuestionChanged    = false;
 }
Exemple #11
0
        private void btnEditPartici_Click(object sender, EventArgs e)
        {
            string ParticiID = string.Empty;

            try
            {
                ParticiID = ((KeyValuePair <string, string>)cbParticipent.SelectedItem).Key;
                ResetAll();
                LoadPartiQB(ParticiID);
                LoadAllQB();
                LoadParticipentCombo();
                ParticipentQBEntityState = EntityOperationalState.Update;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #12
0
        private void dgvAnswers_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            List <Answer>       answerColl = null;
            List <string>       answerIDs  = null;
            MasterDataFunctions mDataFunc  = null;

            try
            {
                mDataFunc = new MasterDataFunctions();
                answerIDs = new List <string>();
                answerIDs.Add(dgvAnswers.Rows[e.RowIndex].Cells[0].Value.ToString());
                answerColl   = mDataFunc.LoadAnswersByID(answerIDs);
                EditedAnswer = answerColl[0];

                txtAnswer.Text      = dgvAnswers.Rows[e.RowIndex].Cells[1].Value.ToString();
                txtAnswerOrder.Text = dgvAnswers.Rows[e.RowIndex].Cells[2].Value.ToString();
                txtAnsweValue.Text  = dgvAnswers.Rows[e.RowIndex].Cells[3].Value.ToString();
                AnswerOperatonState = EntityOperationalState.Update;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #13
0
 private void frmAnswers_Load(object sender, EventArgs e)
 {
     AnswerOperatonState = EntityOperationalState.New;
     LoadAnswers();
 }
Exemple #14
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     ResetAll();
     ParticipentQBEntityState = EntityOperationalState.New;
 }
Exemple #15
0
 private void btnNewQB_Click(object sender, EventArgs e)
 {
     QbQuestionsEntityState = EntityOperationalState.New;
     isQBQuestionChanged    = false;
 }