Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string contents = switchText.Value ? rtxtQuestion.Text : fileName;

            if (RgEx.isEmpty(contents, "Title question"))
            {
                return;
            }
            if (!pnOps.getCountOpValid())
            {
                return;
            }
            if (cbxNameExams.selectedIndex == -1)
            {
                MessBox.Warning("Please Select Exams!!"); return;
            }


            /*Insert Question*/
            Questions qs = new Questions(contents, DateTime.UtcNow.ToShortDateString(), Examcode[cbxNameExams.selectedIndex].ToString(),
                                         FormLogin.username, switchText.Value == true ? "0" : "1", rtxExplain.Text);

            qs.setOption(pnOps.GetOption());
            qs.InsertQuestion();

            Clear();
        }