예제 #1
0
        private void create_Click(object sender, EventArgs e)
        {
            SqlDataAdapter sda = new SqlDataAdapter("Select count(*) From quizzes Where quiz_title ='" + textBoxQuizTitle.Text + "' ", con);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);
            int check = Convert.ToInt32(dt.Rows[0][0].ToString());



            if (splitPicture.ImageLocation == null || textBoxQuizTitle.Text == "" || string.IsNullOrWhiteSpace(textBoxQuizTitle.Text) && textBoxQuizTitle.Text.Length > 0 || textBox1.Text == "" || string.IsNullOrWhiteSpace(textBox1.Text) && textBox1.Text.Length > 0)
            {
                Dialogue.Show("Please Fill All Fields", "", "Ok", "Cancel");
            }

            else if (check >= 1)
            {
                Dialogue.Show("Quiz already exist, please use other Title", "", "Ok", "Cancel");
            }


            else
            {
                SetValueForText3 = splitPicture.ImageLocation;
                SetValueForText2 = textBoxQuizTitle.Text;
                SetValueForText4 = textBox1.Text;

                if (textBoxQuizTimeLimit.Text == "" || string.IsNullOrWhiteSpace(textBoxQuizTimeLimit.Text) && textBoxQuizTimeLimit.Text.Length > 0)
                {
                    time = "";
                }
                else
                {
                    if (bunifuDropdown1.selectedIndex == 0)//Minutes
                    {
                        time = textBoxQuizTimeLimit.Text + "(Minutes)";
                    }

                    else
                    {
                        time = textBoxQuizTimeLimit.Text + "(Seconds)";
                    }
                }

                SetWidth  = splitPicture.Image.Width;
                SetHeight = splitPicture.Image.Height;


                this.Hide();
                PicturePuzzle pz = new PicturePuzzle();
                pz.ShowDialog();
            }
        }
예제 #2
0
        private void bunifuFlatButton5_Click(object sender, EventArgs e)
        {
            if (type == true)
            {
                QuizBee QB = (QuizBee)Application.OpenForms["QuizBee"];
                QB.ImportQA(bunifuDropdown1.selectedValue);
                this.Close();
            }

            else
            {
                PicturePuzzle PZ = (PicturePuzzle)Application.OpenForms["PicturePuzzle"];
                PZ.ImportQA(bunifuDropdown1.selectedValue);
                this.Close();
            }
        }