Exemplo n.º 1
0
        public FormShowQuiz(Group_Soal group, Soal soal, List <Soal_Pilihan_Multiple> multiples)
        {
            InitializeComponent();

            this.DialogResult     = DialogResult.No;
            this.FormClosing     += FormShowQuiz_FormClosing;
            _group                = group;
            _soal                 = soal;
            _soalPilihanMultiples = multiples;

            Fill();
        }
        private void cmdPilihGroup_Click(object sender, EventArgs e)
        {
            GroupTerpilih = new List <Group_Soal>();
            foreach (DataGridViewRow row in gvGroupSoal.Rows)
            {
                DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["ColumnCheckBox"];
                if (chk.Value != null && bool.Parse(chk.Value.ToString()) == true)
                {
                    Group_Soal gs = new Group_Soal()
                    {
                        gs_id   = int.Parse(chk.OwningRow.Cells["gs_id"].Value.ToString()),
                        gs_name = chk.OwningRow.Cells["gs_name"].Value.ToString()
                    };

                    GroupTerpilih.Add(gs);
                }
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }