public static dgvRowIntoQuestion ( System.Windows.Forms.DataGridViewRow dgvRow ) : |
||
dgvRow | System.Windows.Forms.DataGridViewRow | |
return |
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(); } }
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); } } }
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(); } }
private void viewToolStripMenuItem2_Click(object sender, EventArgs e) { new frmAnswers(Utilities.dgvRowIntoQuestion(dgvMyTest.SelectedRows[0])).Show(); }
private void editToolStripMenuItem_Click(object sender, EventArgs e) { new frmEdit(Utilities.dgvRowIntoQuestion(dgvMyQ.SelectedRows[0])).ShowDialog(); }