예제 #1
0
        private void btn_show_answers_Click(object sender, EventArgs e)
        {
            List <int> _listidtr = new List <int>();

            foreach (DataGridViewRow r in dg_testresults.Rows)
            {
                if (Convert.ToBoolean(r.Cells[2].Value) == true)
                {
                    _listidtr.Add(Convert.ToInt16(r.Cells[0].Value));
                }
            }

            if (_listidtr.Count() != 0)
            {
                foreach (int i in _listidtr)
                {
                    human      h = _fe.humans.First(hh => hh.idh == _currenthumanid);
                    testresult t = _fe.testresults.First(tr => tr.idtr == i);
                    if (_ge.testsparams.First(tp => tp.idt == t.testid).answerscount != 0)
                    {
                        TestResultForm testform = new TestResultForm(t, h.idh, _ge, _fe);
                        testform.Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
                        testform.ShowDialog();
                    }
                }
            }
            else
            {
                MessageBox.Show("Нужно выбрать хоть один тест");
            }
        }
예제 #2
0
        private void btn_show_answers_Click(object sender, EventArgs e)
        {
            List<int> _listidtr = new List<int>();

            foreach (DataGridViewRow r in dg_testresults.Rows)
            {
                if (Convert.ToBoolean(r.Cells[2].Value) == true) { _listidtr.Add(Convert.ToInt16(r.Cells[0].Value)); }
            }

            if (_listidtr.Count() != 0)
            {
                foreach (int i in _listidtr)
                {
                    human h = _fe.humans.First(hh => hh.idh == _currenthumanid);
                    testresult t = _fe.testresults.First(tr => tr.idtr == i);
                    if (_ge.testsparams.First(tp => tp.idt == t.testid).answerscount != 0)
                    {
                        TestResultForm testform = new TestResultForm(t,h.idh,_ge, _fe);
                        testform.Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
                        testform.ShowDialog();

                    }
                }
            }
            else { MessageBox.Show("Нужно выбрать хоть один тест"); }
        }