dgvRowIntoQuestion() public static method

public static dgvRowIntoQuestion ( System.Windows.Forms.DataGridViewRow dgvRow ) : Question
dgvRow System.Windows.Forms.DataGridViewRow
return Question
Ejemplo n.º 1
0
 private void dgvFoundQ_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvFoundQ.SelectedRows.Count > 0 && e.ColumnIndex >= 0 && e.RowIndex >= 0)
     {
         new frmAnswers(Utilities.dgvRowIntoQuestion(dgvFoundQ.SelectedRows[0])).Show();
     }
 }
Ejemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            List <Question> myTest = new List <Question>();

            if (string.IsNullOrWhiteSpace(txtTestTitle.Text))
            {
                Utilities.notifyThem(ntfTest, "No title found", NotificationBox.Type.Warning);
            }
            else if (dgvMyTest.Rows.Count < 1)
            {
                Utilities.notifyThem(ntfTest, "No Questions Found", NotificationBox.Type.Warning);
            }
            else
            {
                foreach (DataGridViewRow row in dgvMyTest.Rows)
                {
                    myTest.Add(Utilities.dgvRowIntoQuestion(row));
                }

                SaveFileDialog sfd = new SaveFileDialog();
                sfd.Filter = "PDF file|*.pdf";
                sfd.Title  = "Save The Test into a PDF file";
                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    SavePDF.SetTest(txtTestTitle.Text, datePicker.Value.ToShortDateString(), myTest, checkBoxAnsweredTest.Checked, sfd.FileName);
                    SavePDF.SaveTest();
                    Utilities.notifyThem(ntfTest, "Successfully Saved", NotificationBox.Type.Success);
                }
            }
        }
Ejemplo n.º 3
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            List <Question> myTest = new List <Question>();

            if (string.IsNullOrWhiteSpace(txtTestTitle.Text))
            {
                Utilities.notifyThem(ntfTest, "No title found", NotificationBox.Type.Warning);
            }
            else if (dgvMyTest.Rows.Count < 1)
            {
                Utilities.notifyThem(ntfTest, "No Questions Found", NotificationBox.Type.Warning);
            }
            else
            {
                foreach (DataGridViewRow row in dgvMyTest.Rows)
                {
                    myTest.Add(Utilities.dgvRowIntoQuestion(row));
                }

                PrintTest.Initialize();
                PrintTest.SetTest(txtTestTitle.Text, datePicker.Value.ToShortDateString(), myTest, checkBoxAnsweredTest.Checked);
                Globals.formPrint.Document = PrintTest.Document;
                Globals.formPrint.ShowDialog();
            }
        }
Ejemplo n.º 4
0
 private void viewToolStripMenuItem2_Click(object sender, EventArgs e)
 {
     new frmAnswers(Utilities.dgvRowIntoQuestion(dgvMyTest.SelectedRows[0])).Show();
 }
Ejemplo n.º 5
0
 private void editToolStripMenuItem_Click(object sender, EventArgs e)
 {
     new frmEdit(Utilities.dgvRowIntoQuestion(dgvMyQ.SelectedRows[0])).ShowDialog();
 }