예제 #1
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItems.Count > 0)
            {
                createQuizParentWindow.MdiParent = form1;
                createQuizParentWindow.Show();
                createQuizParentWindow.BringToFront();
                createQuizParentWindow.Dock = DockStyle.Top;



                //setting the isQuizSavedflag;

                GlobalStaticVariablesAndMethods.isCurrentQuizTopicSaved = false;

                //Create a dataset to hold the questions...

                GlobalStaticVariablesAndMethods.currentQuectionNumber = 1;

                GlobalStaticVariablesAndMethods.currentDataSetUsedForHoldingQuestions = DatasetManager.createDataSetForHoldingQuestions(GlobalStaticVariablesAndMethods.currentSubjectName);
                GlobalStaticVariablesAndMethods.currentSizeOfDataSet = GlobalStaticVariablesAndMethods.currentDataSetUsedForHoldingQuestions.Tables[0].Rows.Count;

                //We will now use this gloabl variable to store questions.
                this.Hide();
            }
            else
            {
                GlobalStaticVariablesAndMethods.CreateErrorMessage(GlobalStaticVariablesAndMethods.NoTopicSelectedErrorMessage);
            }
        }
예제 #2
0
        private void buttonCreateNewQuiz_Click(object sender, EventArgs e)
        {
            if (GlobalStaticVariablesAndMethods.isCurrentQuizTopicSaved)
            {
                HideChild();

                GlobalStaticVariablesAndMethods.currentTopicName   = null; //this will be setted from dialog window which we are opening down
                GlobalStaticVariablesAndMethods.currentSubjectName = null; //this will be setted from dialog window which we are opening down

                GetQuizTopicNameWindow getQuizTopicNameWindow = new GetQuizTopicNameWindow();
                getQuizTopicNameWindow.ShowDialog();


                if (GlobalStaticVariablesAndMethods.currentTopicName != null)
                {
                    //this means some topic name is provided
                    createQuizParentWindow.MdiParent = this;
                    createQuizParentWindow.Show();
                    createQuizParentWindow.BringToFront();
                    createQuizParentWindow.Dock = DockStyle.Top;

                    //setting the isQuizSavedflag;

                    GlobalStaticVariablesAndMethods.isCurrentQuizTopicSaved = false;

                    //Create a dataset to hold the questions...

                    GlobalStaticVariablesAndMethods.currentQuectionNumber = 1;

                    GlobalStaticVariablesAndMethods.currentDataSetUsedForHoldingQuestions = DatasetManager.createDataSetForHoldingQuestions(GlobalStaticVariablesAndMethods.currentSubjectName);
                    GlobalStaticVariablesAndMethods.currentSizeOfDataSet = GlobalStaticVariablesAndMethods.currentDataSetUsedForHoldingQuestions.Tables[0].Rows.Count;

                    //We will now use this gloabl variable to store questions.
                }
                else
                {
                    GlobalStaticVariablesAndMethods.isCurrentQuizTopicSaved = true;
                }
            }
            else
            {
                GlobalStaticVariablesAndMethods.CreateErrorMessage(GlobalStaticVariablesAndMethods.UnsavedQuizErrorMessage);
            }
            //Open dialog
        }